Feature Experimentation API
Sending Events/Goals (Track)
The purpose of the /track
endpoint is to register events/goals for the user. This can be used to measure how well a feature or a specific variation works.
On this page
Introduction to the use
There are three general types of events:
pageview
represents a call to a views/pageclick
represents a click of the user on a specific elementcustom
is an event of any other type. Here it is possible to specify values (value) in addition to the actual triggering (conversion)
A pageview
event is implicitly provided by default with every decide call.
Payload of a /track
request
https://fe-api.ablyft.com/v1/track
HTTP method | POST |
Headers |
|
Body (JSON) |
-
user
-
bucketing object required
Representation of the current user bucket (experiments in which the user is already in / analogous to the client-side cookie
ablyft_exps
).
-
bucketing object required
-
events array
-
event object
-
id integer required
ID created by the platform.
-
type string required
Type of the goal/event created in the platform.
-
value integer or float
If the value for the goal/event is to be counted (instead of treating it as a conversion).
-
id integer required
-
event object
{
user: {
bucketing: {
"12345678": 87654321,
"87654321": 12345678
}
},
events: [
{
id: 45645645,
type: "custom",
value: 123.34
}
]
}
Understanding the response
A request has an empty response body.
HTTP response status codes
204 | OK | The request succeeded (no content) |
400 | Bad Request | Error in request, only JSON is valid |
401 | Unauthorized | API token denied |
405 | Method Not Allowed | Only HTTPS and POST is valid |
429 | Too Many Requests | The rate limit was reached |
500 | Internal Server Error | Any other internal error |