Implementation Overview

The first step to implement Monetate is to determine how you want to deploy it. The Monetate Developer Hub contains information that you and your team of front-end developers can use to determine which implementation type would work best for your technologies and digital presence. The primary implementation options are the Monetate JavaScript API and the Engine API.

JavaScript API and the Monetate Tag

The Monetate JavaScript API allows you to pass page-level data to the Monetate platform via the Monetate tag, a block of JavaScript code that you place within your site's global <head> element, and various JavaScript method calls. The Monetate tag is the foundation for using Monetate to test, personalize, merchandise, and measure anything on your site.

In a traditional Monetate tag–based integration, Monetate is running in the browser and can directly manipulate your site by inserting, editing, or removing content via reusable actions. Monetate can additionally leverage DOM elements (cookies, JavaScript variables, HTML elements) to target and track site-specific segments and events. By implementing the Monetate JavaScript API methods, Monetate additionally collects (and targets against) behavioral data such as products that have been viewed, carted, and purchased.

There are two versions of the Monetate tag: synchronous and asynchronous. Which version you deploy typically depends on how your site is set up.

Synchronous Tag

Your site's code guarantees priority for the synchronous Monetate tag, which allows the tag to display all content at the same time and deliver a consistent experience for your customers. Because this version of the Monetate tag loads via a blocking script, it has the potential to slightly extend page load time.

That said, the synchronous version of the tag doesn't display any visual artifact of your native site before Monetate's content renders. Although Monetate cannot guarantee that this call completes within a specified time range, there's typically no material impact to the customer and the Monetate-optimized experience they're served.

Asynchronous Tag

The asynchronous Monetate tag loads independent of your site. It doesn't affect your site's load time or performance.

Due to the priority given to your site's content when the browser loads your page and the robust nature of the Monetate platform, by using the asynchronous tag you face the slight possibility that customers may see a visual artifact, known as flicker, of your native site experience before the Monetate-optimized experience renders.

For more in-depth information about the Monetate tag, its synchronous and asynchronous versions, and how they compare, see the Monetate Developer Hub's documentation for a baseline Monetate JavaScript API implementation.

Capturing Site Structure with Page Types

The Monetate JavaScript API's methods allow you to use Monetate to track and target visitors based on onsite behavior (for example, products browsed, products purchased, amount in cart), to capture conversions, and to better understand the structure of your site. The setPageType method call sends the page type for a page that a site visitor is on to Monetate. This information also allows you to limit actions to specific page types when you add action conditions to Web experiences.

Key pages to set page types for include the homepage, index page, search page, product detail page, cart page, checkout page, and purchase confirmation page. You can include other page types as well, such as a store locator page and a Contact Us page.

See Example Implementations by Page Type in the Monetate Developer Hub to better understand how to deploy setPageType and other key JavaScript API method calls on your site to make the most of Monetate's features.

Engine API

Monetate's Engine API serves as a direct entry point to Monetate's decision engine and allows clients to use it in any channel: Web (server-side or within the browser), mobile applications, single-page application frameworks, and nontraditional implementations such as in-store displays or SMS/text messaging. When using this RESTful API Engine API, you must pass all page- and visitor-level data to Monetate within the request body.

The Engine API allows three things to be done with a single call:

  • Send contextual information about the current visitor/page.
  • Retrieve actions that are supposed to fire in the current context. These actions can be part of any Omnichannel experience in Monetate and can be a mix of personalized content and tests to be activated.
  • Send events/metrics to Monetate to measure success.

Bundling all these capabilities into a single endpoint allows all data to be received via a single call and reduces latency when transmitting to Monetate.

The full API reference as well as additional information about the Engine API are availabe in the Monetate Developer Hub.