User 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 user events that you send using the Buy with Prime Analytics interface. Some fields are provided by default. You can emit additional optional properties in the additionalProperties list within the user event.

Schema

This section shows the schema for the user events that you send using the Analytics interface 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 user 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 user events. For example, server-side user 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 user event is validated against the latest default schema, which contains all possible fields.

Fields

Field NameData TypeRequired?Description
eventTypeStringYes

Type of user event. Valid values:

  • page-load: After putting Buy with Prime products in their cart and successfully signing in using their Amazon account credentials, the shopper views the pre-order review page or the post-order confirmation page.
  • click: The shopper adds a Buy with Prime product to their cart or they click the Buy with Prime button to start checkout.
  • widget-viewed: The Prime badge is rendered on a page.
  • bwp-widget-promise-loaded: The Buy with Prime delivery estimate is rendered or the shopper switches to a different variant within the same product detail page.
eventIdStringYesUUID (v4) for each user event emitted. This ID doesn't need to be globally unique across clients.
eventTimeDateTimeYesDate-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.
clientTypeEnumYesType of client. Valid values: ClientType.WEBSITE_CLIENT or ClientType.SERVER_CLIENT.
clientVersionStringYesVersion number of the client. Example: 10.
schemaNameStringNoName of the schema. If not specified, the schema defaults to a schema with all attributes.
schemaVersionStringNoVersion number of the schema. If not specified, the version number defaults to the latest schema version.
additionalPropertiesProperty TupleNoAny additional properties that you add to the user 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 user event.

Field NameData TypeRequired?Description
ipStringNoClient network IP address.
currentUrlStringNo(Web-generated user 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.
referrerStringNo(Web-generated user 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.
pageViewIdStringNoUnique ID for each page view and subsequent custom user events fired from the same page.
userAgentStringNoRaw user agent HTTP value.
ubidStringNoRandom 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.
sessionIdStringNoUnique identifier for a web session.
screenHeightStringNoBrowser screen height.
screenWidthStringNoBrowser screen width.
initialReferrerStringNoInitial URL or URI that referred the user to the current URL.
pageTypeStringNoType of page. Examples: cart, checkout, pdp (product detail page).
pageActionStringNoAction taken on the page. Examples: bwp-button-clicked, checkout-clicked.

Related topics