Analytics Event Schema
Buy with Prime API is now available for early access
Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.
This topic shows the fields that you include in events that you send to the Buy with Prime Analytics interface. Some fields are provided by default. You can emit additional optional properties in the additionalProperties
list within the event.
Schema
This section shows the schema for the events that you send by using the sendUserEvents
mutation. The required fields must be in a particular format; failure to conform to the suggested format leads to a validation exception, and the event is dropped.
The optional properties suggest a format for the given value but are not strictly validated against the suggested format. Some of the optional properties might not be applicable to the way you track events. For example, server-side events might not contain screen height or width level information as part of the event.
If you don't specify a schemaName
, the schema defaults to a schema with all attributes. If you don't specify a schemaVersion
, the event is validated against the latest default schema, which contains all possible fields.
Fields
Field Name | Data Type | Required? | Description |
---|---|---|---|
eventName | String | Yes | Type of event. Valid values:
|
eventId | String | Yes | UUID (v4) for each event emitted. This ID doesn't need to be globally unique across clients. |
timestamp | DateTime | Yes | Date-time string for UTC, such as 2007-12-03T10:15:30Z , compliant with the date-time format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. |
clientType | Enum | Yes | Type of client. Valid values: ClientType.WEB_CLIENT , ClientType.SERVER_CLIENT , ClientType.ANDROID , ClientType.IOS . |
clientVersion | String | Yes | Version number of the client. Example: 10 . |
applicationId | String | Yes | Descriptive string of the application that publishes the event. Valid values: STORE_FRONT_WEBSITE ,SHOPIFY_STOREFRONT , SFCC_STOREFRONT (for Salesforce Commerce Cloud). |
schemaName | String | No | Name of the schema. If not specified, the schema defaults to a schema with all attributes. |
schemaVersion | String | No | Version number of the schema. If not specified, the version number defaults to the latest schema version. |
additionalProperties | Property Tuple | No | Any additional properties that you add to the event. You pass these as a list tuple that contains the property names and values. For the fields, see Additional properties. |
Additional properties
You can include the following optional fields in the additionalProperties
list of the event.
Field Name | Data Type | Required? | Description |
---|---|---|---|
ip | String | No | Client network IP address. |
currentUrl | String | No | (Web-generated events only) Web address that the shopper visited. We recommend that you encode this value as a URL and include the complete value of the URL parameters without truncation. |
referrer | String | No | (Web-generated events only) Web page previously visited before the current page. For example, if a shopper was on http://example.com/product-1 and then clicked a link or button and navigated to another page, the referrer property value is http://example.com/product-1 . In some cases, this value can be a URI. If the shopper visits the web page directly, the value of the property should be $direct . |
pageViewId | String | No | Unique ID for each page view and subsequent custom events fired from the same page. |
userAgent | String | No | Raw user agent HTTP value. |
ubid | String | No | Random string that persists on user cookies to identify the user's device and anonymous users. This value doesn't change unless the browser cookies are cleared. |
sessionId | String | No | Unique identifier for a web session. |
screenHeight | String | No | Browser screen height. |
screenWidth | String | No | Browser screen width. |
initialReferrer | String | No | Initial URL or URI that referred the user to the current URL. |
pageType | String | No | Type of page. Examples: cart , checkout , pdp (product detail page). |
pageAction | String | No | Action taken on the page. Examples: bwp-button-clicked , checkout-clicked . |
Related topics
Updated 3 days ago