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.

User events that you send to your Buy with Prime account to Get User Engagement Data use the required schema. If you send an event that doesn't conform to the required format for elements, the user event is dropped and you get a validation exception.

In the user event, if you don't specify a schemaName and schemaVersion, the Buy with Prime API uses the latest default schema.

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.
eventTimeDateTimeYesThe date and time when the user event was generated in 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.
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