Einstein Recommendation Collect Tracking API

Einstein Recommendation Collect Tracking calls are available to be implemented with a server side option. To use these implementation methods, make an HTTP POST call to the appropriate URL, with the corresponding payload parameter values.

In order to manage session and user values you’ll must send user_id and session_id on the same node level as the payload. On the first call, you don't must pass these values and they’re returned in the JSON response.

See the parameter definitions and example URLs below.

All calls must be sent with Content-Type: application/json.

Below is a sample of the minimum requirement to implement an observation script, also referred to as “Collect".

A unique client identifier, typically the MID associated with the Marketing Cloud Business Unit.

The title of the page the user is viewing. This is pulled from the page title with web applications.

The url or path to the application page.

The previous page or referring url for the application.

Any page where the user’s email address (or other identifier) is known to the site, this value should be sent. The users email address should be sent on the following pages and any others where the users email address is known: Newsletter signup, login, account overview, cart, checkout, purchase confirmation, order history.

The user_id value returned from the first Collect API call for an individual user. This value should be persisted for all future API calls for that individual.

If you are unable to persist this value for future sessions, a new profile may will be created along with the new session. Duplicate records sharing the same email will be merged at the end of the session.

The session_id value returned from the first Collect API call for the user’s current session. This value should be persisted for all API calls in an individual’s session.

The following sample implements an observation script to track a specific item detail page view.

Represents the item that is being displayed to the customer, such as on an item detail page.

The following sample implements an observation script to track when a user submits a rating for a specific item, using the minimum requirements.

This variable should be populated with a numerical representation of the rating submitted by the user, only when the user has actually rated the item. The item value must be passed in within the same call in order for the rating to be properly recorded.

The following sample implements an observation script to track a snapshot of all items in the user’s cart.

This variable should be sent with an identifier of the item that is in the user’s cart.

This variable should contain the quantities of each corresponding item in the.

This variable should contain the unit price for each corresponding cart item. Even if the customer is purchasing multiples of an item this variable should still be sent with the unit price.

The following sample implements an observation script to indicate that the user has emptied their shopping cart.

When true, indicates that the user has removed all items from their shopping cart.

The following sample implements an observation script to track a conversion event.

This is a value that should contain the customer’s order number once a conversion event occurs.

This optional variable may be sent with the shipping charge associated with the user’s order.

This optional variable may be sent with the discount amount that was applied to the user’s order.

The following sample implements an observation script to track a specific item detail page view.

This variable is used to hold search terms. This variable should be populated with internal and external search terms (for example, from Google) when available. Example: search=Blue Sky

The following sample implements an observation script to track a specific item detail page view.

This variable should be sent on each category and subcategory page.

This sample implements streaming updates to a single item in your catalog.

Replace the INSERT_ values with dynamic code to get the appropriate value for the item. Acceptable values for item_type are content, product, or banner. If the value for item_type is not specified, or the value provided is not recognized, it defaults to content.

This sample updates multiple items in your catalog.

Replace the INSERT_ values with dynamic code to get the appropriate value for the item. Acceptable values for item_type are content, product, or banner. If the value for item_type is not specified, or the value provided is not recognized, it defaults to content.

Use this sample when an attribute has multiple values.

This sample updates the availability of an item in your catalog. Possible values are: Y, or N