Calling the Engine API

Annotated Example Engine API Request

The following code is an example request to the Monetate Engine API. Each object is described separately afterward.

Example Engine API Request


Objects

Device ID

The device ID can be sent with new visitors without mt.v, but it's normally used for apps and similar situations in which cookie IDs are not possible. It's used for targeting and action conditions.

Example deviceID


mt.v Value

If no customer identifier is passed in the request, then a monetateID value is returned and the session is considered as a new visitor for targeting and analytics. See User Identity Persistence in Requests for more information.

Example monetateID


Preview Flag

If the session is a preview, then include the token ID for this object for experience and split preview.

Example preview ID


Unique Customer ID

A unique customerID value is used for Customer View and customer datasets.

Example customerID


Channel

The channel value is your Monetate account information.

Example channel


Events

The following objects are data passed to Monetate for experiences and analytics.

Action Type Filters, Managed Impressions, and Reporting

The following code example is an Engine API decision request event with filtering for certain action types, managed impressions, and whether to include reporting in the response. The filters parameter can be used to filter certain action types.

Example Request Event for Filtering, Managed Impressions, & Reporting


IP Address

The following code example is an Engine API decision request event for the IP address. This information is used for targeting and analytics.

Example Request Event for IP Address


Coordinates

The following code example is an Engine API decision request event for a customer device's physical coordinates expressed in longitude and latitude. This information is used for targeting and analytics.

Example Request Event for Coordinates


User Agent

The following code example is an Engine API decision request event for the User-Agent header. This information is used for targeting and analytics.

Example Request Event for User-Agent Header


Screen Size

The following code example is an Engine API decision request event for the screen size of the customer's device. This information is used for targeting.

Example Request Event for Device Screen Size


Metadata

The following code example is an Engine API decision request event for customer-specific metadata. This information is used for targeting and action conditions.

Example Request Event for Metadata


Custom Variables

The following code example is an Engine API decision request event for a custom variable and its value. This information is used for targeting.

Example Request Event for Custom Variable


Page View and Type

The following code example is an Engine API decision request event for a page view and its page type. This information is used for action conditions. See Action Condition Mapping for more details.

Example Request Event for Page View and Page Type


Referrer

The following code example is an Engine API decision request event for a referring URL. This information is used for targeting and action conditions.

Example Request for Referrer


Custom Page Events

The following code example is an Engine API decision request event for custom page events. This information is used for analytics.

Example Request for Custom Page Events


Search Results or Product List Pages

The following code example is an Engine API decision request event captures product thumbnail views on search results pages, product list pages. This information is used for targeting and action conditions.

Example Request for Product Thumbnail Views


Product Detail Pages

The following code example is an Engine API decision request event captures product detail page views. This information is used for targeting and action conditions.

Example Request for Product Detail Page Views


Cart Pages

The following code example is an Engine API decision request event captures information about products in a customer's cart. This information is used for targeting, action conditions, and analytics.

Example Request for Carted Products


Purchases Pages

The following code example is an Engine API decision request event that captures information about products that a customer has finished buying that appear on a "Purchase Complete" or similar page. This information is used for targeting and analytics.

Example Request for Purchased Products


Impressions

The following code example is an Engine API decision request event that captures impressions. When manageImpressions is set to true, this event tells Monetate that the impression happened.

Example Request for Impressions