Analytics Events

Send user events from your Yext digital experiences to Yext Analytics in near real-time.

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.

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 pattern: "^[a-zA-Z][a-zA-Z0-9_]{0,31}$"

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 pattern: "^[a-zA-Z][a-zA-Z0-9_]{0,31}$"

destinationUrl
string <uri> (URL)

The URL of the page the event is directing the visitor to. format: uri

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.

Location (object) or $auto (string) or null (null)
Default: "$auto"

The location information of the visitor for the event.

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.

searchTerm
string [ 1 .. 16777216 ] characters

The query entered by the user.

sessionId
string^[\x20-\x7E]{1,36}$

ID of the user session associated with event. pattern: "^[\x20-\x7E]{1,36}$"

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 <= 1 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

Content type
application/json
{
  • "action": "ADD_TO_CART",
  • "authorization": "string",
  • "bot": "$auto",
  • "browserAgent": {
    },
  • "chat": {
    },
  • "count": 1,
  • "customTags": {
    },
  • "customValues": {
    },
  • "destinationUrl": "http://example.com",
  • "entity": "string",
  • "internalUser": false,
  • "ip": {
    },
  • "label": "string",
  • "locale": "$auto",
  • "location": "$auto",
  • "pageUrl": "http://example.com",
  • "referrerUrl": "http://example.com",
  • "searchTerm": "string",
  • "sessionId": "string",
  • "timestamp": "$auto",
  • "value": {
    },
  • "visitor": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string"
}