Analytics Events
Send user events from your Yext digital experiences to Yext Analytics in near real-time.
This documentation is for version 1.0.0 of the Events API. If you are still using version
0.6, refer to the documentation in the yext/analytics Github repository
here.
Request Body schema: application/json
JSON object containing the events to be sent to Yext Analytics
required | Standard (string) or Custom (string) The action which caused the event. |
| authorization | string [ 1 .. 8192 ] characters ^(KEY|Bearer)\s.+$ An alternative to using the Authorization HTTP header. If a value is provided, it will override any Authorization header. Api keys should be formatted like "KEY <apiKey>", access tokens should be formatted like "Bearer <bearerToken>" |
boolean or $auto (string) Default: "$auto" Whether the event is the result of bot activity. | |
object Default: {"browser":"$auto","browserVersion":"$auto","device":"$auto","deviceClass":"$auto","os":"$auto","osVersion":"$auto","userAgent":"$auto"} Information about the visitor's device and browser. | |
object (Chat) The Yext Chat properties of the event. | |
object (Client SDK) <= 100 properties For the Yext client SDKs involved in the event, this is an object mapping the names of those SDKs to the version labels of those SDKs. | |
| count | integer [ 1 .. 1000000000 ] Default: 1 When one record summarizes multiple events, this is the number of events the record represents. The event is treated as if it is duplicated this many times. |
object <= 10 properties Up to 10 pairs matching custom string keys to string values to associate with the event. Keys are case-insensitive; values are case-sensitive. Property Name | |
object <= 10 properties Up to 10 pairs matching custom string keys to number values to associate with the event. Keys are case-insensitive. Property Name | |
| destinationUrl | string <uri> (URL) The URL of the page the event is directing the visitor to. |
entityId (string) or entityUid (integer) | |
| internalUser | boolean Default: false Indicates whether the event is the result of internal activity. |
IP (object) or null (null) Default: {"address":"$auto","algorithm":"HASH"} The IP address for the event. | |
| label | string [ 1 .. 16777216 ] characters A label assigned to the event, e.g. a CTA label. |
Locale (string) or $auto (string) or null (null) Default: "$auto" The locale of the user who generated the event. | |
Coordinates Object (object) or Country Code (string) The location information of the visitor for the event. Either a Coordinates object with both latitude and longitude or a string with the country of the visitor for the event, as a ISO 3166-1 alpha-2 country code. | |
object (Pages) Fields specific to reporting Yext Pages Analytics Events | |
URL (string) or $auto (string) or null (null) The URL of the page the event occurred on. | |
URL (string) or null (null) The URL of the page which the visitor came from prior to the event. | |
object (Search) Fields specific to reporting Yext Search Analytics Events | |
| searchTerm | string [ 1 .. 16777216 ] characters The query entered by the user. |
Session ID (string) or null (null) ID of the user session associated with event. | |
ISO Timestamp (string) or Epoch millisecond (number) or $auto (string) Default: "$auto" The timestamp at which the event occurred. | |
object (Value) The monetary value of the event | |
object <= 100 properties The visitor related to the event. Keys are visitor methods and values are visitor IDs. PropertyName pattern: "^[a-zA-Z0-9_-]{1,16}$". Value pattern: "^[\x20-\x7E]{1,64}$" |
Responses
Request samples
- Payload
{- "action": "ADD_TO_CART",
- "authorization": "string",
- "bot": "$auto",
- "browserAgent": {
- "browser": "$auto",
- "browserVersion": "$auto",
- "device": "$auto",
- "deviceClass": "$auto",
- "os": "$auto",
- "osVersion": "$auto",
- "userAgent": "$auto"
}, - "chat": {
- "botId": "string",
- "conversationId": "MDFIQjlKWkM5SlhaU0dEUjJNRFBCUFdLWTHeIqvURTeRr2EC",
- "responseId": "string"
}, - "clientSdk": {
- "^[a-zA-Z][a-zA-Z0-9_]{0,31}$": "string"
}, - "count": 1,
- "customTags": {
- "^[a-zA-Z][a-zA-Z0-9_]{0,31}$": "string"
}, - "customValues": {
- "^[a-zA-Z][a-zA-Z0-9_]{0,31}$": 1
}, - "entity": "string",
- "internalUser": false,
- "ip": {
- "address": "$auto",
- "algorithm": "HASH"
}, - "label": "string",
- "locale": "$auto",
- "location": {
- "coordinates": {
- "latitude": -90,
- "longitude": -180
}
}, - "pages": {
- "scope": "string",
- "originalEventName": "string",
- "siteUid": 0,
- "template": "string"
}, - "search": {
- "searchId": "string",
- "queryId": "string",
- "verticalKey": "string",
- "isDirectAnswer": true,
- "versionLabel": "PRODUCTION",
- "versionNumber": 0,
- "experienceKey": "string",
- "isGenerativeDirectAnswer": true
}, - "searchTerm": "string",
- "sessionId": "string",
- "timestamp": "$auto",
- "value": {
- "amount": 0,
- "currency": "str"
}, - "visitor": {
- "^[a-zA-Z0-9_-]{1,16}$": "string"
}
}Response samples
- 202
- 429
- default
{- "id": "string"
}