Publish Experiment Events for Multiple Contexts
PUT/context/batch
A PUT request for publishing your exposures, goals and attributes from multiple contexts.
Request
Header Parameters
The User-Agent of your SDK.
The environment in which you are running your experiments. These can be found and created in your ABsmartly Web Console settings.
The application in which you are running your experiments. These can be found and created in your ABsmartly Web Console settings.
The application version which you are running your experiments on.
- application/json
Body
required
An array of data to publish.
Hashed
The hashed value describes whether your values have already been hashed, or if they are to be hashed by the Collector.
Historic
The historic value tells the Collector whether this is new or old data.
Published At
The publishedAt value is the time at which the request was made.
Units
Units are the values which are used to choose the variant assignments for each user. Unit types can be found and created in your ABsmartly Web Console settings. The payload takes the form of:
{
"type": "user_id" // The name of the unit type
"uid": "4a42766ca6313d26f49985e799ff4f3790fb86efa0fce46edb3ea8fbf1ea3408" // The value of the unit that you are tracking.
}
Exposures
Exposures tell the collector information about which variant of an experiment was shown to the user, and when:
{
"id": 3, // The ID of the exposed experiment.
"name": "exp_banner_color", // The name of the exposed experiment.
"unit": "user_id", // The unit that was used together with the experiment seed to generate the variant.
"variant": 1, // The variant that was shown.
"exposedAt": 1609244179528, // The time at which the exposure happened.
"assigned": true, // Whether the user was exposed to the experiment in this specific request, it could be that the user was not assigned because it doesn’t match the audience, or the experiment is already fullOn, or the variant was overriden, etc.
"eligible": true, // Whether the experiment is in the right part of the traffic allocation to this experiment and can be triggered.
"overridden": false, // Whether the variant was overridden or not.
"fullOn": false, // True if this experiment is fullOn and the winning variant is being forced to everyone.
"custom": false, // Whether this variant was a custom assignment.
"audienceMismatch": false // Whether this variant was shown outside of it’s specified target audience.
}
Goals
Goals are used to track various metrics that are related to your experiment. Goals can be created and found in your ABsmartly Web Console settings:
{
"name": "banner_click", // The name of the goal that you are tracking.
"achievedAt": 1609254179528, // The time that the goal was achieved.
"properties": {} // Any properties that you wish to pass along with this goal.
}
Attributes
Attributes allow for segmentation of your data on the Web Console:
{
"name": "age", // The name of the attribute.
"value": 39, // The attribute's value.
"setAt": 1609244179528 // The time at which the value was set.
}
- Array [
- Array [
- ]
- Array [
- ]
- Array [
- ]
- Array [
- ]
- ]
requests object[]required
Possible values: >= 1
, <= 500
units object[]required
Possible values: non-empty
and <= 640 characters
exposures object[]
Possible values: <= 128
goals object[]
attributes object[]
Responses
- 200
- 400
- 401
- default
Success
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
warnings object[]
errors object[]
{
"ok": true,
"warnings": [
{
"batchIndex": 0,
"eventIndex": 0,
"subject": "string",
"message": "string"
}
],
"errors": [
{
"batchIndex": 0,
"eventIndex": 0,
"subject": "string",
"message": "string"
}
]
}
Bad request
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
warnings object[]
errors object[]
{
"ok": true,
"warnings": [
{
"batchIndex": 0,
"eventIndex": 0,
"subject": "string",
"message": "string"
}
],
"errors": [
{
"batchIndex": 0,
"eventIndex": 0,
"subject": "string",
"message": "string"
}
]
}
Unauthorized
Unexpected error
- application/json
- Schema
- Example (from schema)
Schema
{
"code": 0,
"message": "string"
}