Actions
post
/{env}/v1/sites/{site-id}/actions
The *Actions* endpoint tracks actions for the given visitor.
Request
Supported Media Types
- application/json
Path Parameters
-
site-id: string
Unique site identifier. The site id can be retrieved from the REST API.
Actions
Root Schema : actions
Type:
object
Title:
Show Source
actions
-
actions:
array actions
Actions to be tracked for the visitor.
-
ipAddress(optional):
string
(Optional) IP address of the visitor. If omitted, "Source address" field of the packet sender is used to detect the client's IP. Used to track Sandbox actions, in case the client's IP is listed in the Company IPs list.
-
visitorIds(optional):
object visitorIds
(Optional) External visitor identifiers. Can be used for targeting, personalization, segmentation and reporting (via the Campaign Data Export). Pass as "id slot":"value" pairs.
-
visitorState:
string
State of the current visitor as provided in responses of previous requests.
Example:
{
"actions":[
{
"name":"ItemsInBasket",
"value":"3",
"attribute":"USD"
},
{
"name":"OrderValue",
"value":"$5.99"
}
],
"visitorIds":{
"5":"24350056"
},
"visitorState":"-1338188648|AwAAAApVAgB/uLhOWw8AA...ntbDwD/////AVsPWw///wEAAAEA"
}
Nested Schema : visitorIds
Type:
object
(Optional) External visitor identifiers. Can be used for targeting, personalization, segmentation and reporting (via the Campaign Data Export). Pass as "id slot":"value" pairs.
Nested Schema : action
Type:
Show Source
object
-
action.attribute(optional):
string
(Optional) Attribute of the action to be tracked. You can use this to track additional information about the action. E.g. currency for a monetary value.
-
action.name:
string
Name of the action to be tracked. Note that an action should be present for the campaign in order to be tracked.
-
action.value(optional):
string
(Optional) Value of the action to be tracked. You can use this to capture information about an action. E.g. monetary value for a purchase action.
Response
Supported Media Types
- application/json
200 Response
Tracked actions
Root Schema : tracked actions
Type:
object
Title:
Show Source
tracked actions
-
action.name(optional):
string
Name of the action.
-
actions(optional):
object actions
Actions tracked for the visitor.
-
actions.status(optional):
string
Either *success* or *error*.
-
visitorState(optional):
string
Updated state of the current visitor that should be used in the subsequent request.
Example:
{
"actions":[
{
"name":"ItemsInBasket",
"status":"success"
},
{
"name":"OrderValue",
"status":"error",
"errors":[
{
"message":"Invalid action value: '$5.99'. Must be an integer",
"parameter":"value",
"code":"400"
}
]
}
],
"visitorState":"Y2FtcGFpZ25OYW1lOiBjYW1wYWlnbjE7IGV4cGVyaWVuY2VzOiBlbGVtZW50MTp2YXJpYW50MSwgZ2VuZXJhdGlvbmlkOjMyNDMyNDMyNDMy"
}
Nested Schema : actions
Type:
object
Actions tracked for the visitor.