Einstein Recommendation Collect Tracking API

Overview

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 will need to send user_id and session_id on the same node level as the payload. On the first call, you don't need to pass these values and they are 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".

Parameter Definitions

MID

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

title:

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

url:

The url or path to the application page.

referrer:

The previous page or referring url for the application.

email:

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.

user_id:

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.

session_id:

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.

Item Detail View Collect Example

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

Additional Parameter Definitions

item:

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

Real-Time Rating Collect Example

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

Additional Parameter Definitions

rating:

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.

Cart Collect Example

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

Additional Parameter Definitions

item:

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

quantity:

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

price:

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.

Clear Cart Collect Example

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

Additional Parameter Definitions

clear_cart:

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

Conversion Collect Example

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

Additional Parameter Definitions

order_number:

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

shipping:

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

discount:

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

Search Collect Example

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

Additional Parameter Definitions

search:

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

Category Page Collect Example

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

Additional Parameter Definitions

category:

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

Example Response