Monetate JavaScript API Overview

The Monetate JavaScript API allows you to pass page-level data to the Monetate platform. It follows common eCommerce patterns and is straightforward for experienced front-end developers. Each method call is categorized by the type of page for which it is intended or most often used. To do this, you must install the following:

  • The Monetate tag: Helps Monetate understand interactions on your site
  • Monetate Inspector browser plug-in: Verifies the functionality and placement of the Monetate tag on a page

Pass Site Data to Monetate

There are two steps to pass site data to Monetate. The first is to add the Monetate tag to your site, and the second is to add method calls to your site to pass visitor data to Monetate.

Adding the Monetate tag to your site allows you to develop actions with Action Builder, create and track events with Event Builder, and launch experiences.

Method calls allow Monetate to build a page map to better understand your site visitors. It also allows you to use Monetate's behavior-based targeting and to unlock additional metrics in Experience Results beyond what's available out of the box.

For example, if you want to build an experience that considers what products specific customer segments buy or if you want to track KPIs such as conversion rate and abandoned cart rate, you must use the method calls in the Monetate JavaScript API. These calls also allow you to track conversions from your site's shopping cart, track product details, or set page types to take full advantage of Monetate.

Monetate also supports various eCommerce connectors.

Timing Expectations

The time it takes to add the Monetate tag and the required method calls that are important to your business can vary. The number of method calls you must add, your intended use of Monetate, and the skill set of the person completing these tasks can all impact how long it takes to complete the process. For more information about who should complete the various steps of this process and what to expect, refer to Implementation User Role Guide.

Importance and Functions of Monetate JavaScript API Method Calls

The Monetate JavaScript API allows you to send customer interactions with your site to Monetate (for example, adding items to the cart, making a purchase, and more). This enables you to instruct Monetate about your site structure and relevant interactions of any visitor, including the following:

  • Assign page types based on page information and the anatomy of the page, and then use this information to tie actions to page types, which are groups of specific pages (for example, add an action condition in Monetate so that an action only appears on product search pages)
  • Track visitor behaviors, including pages visited, categories searched, and products selected so that you can, for example, create an experience to segment any visitors who previously viewed men's shirts in the last 30 days
  • Track how a visitor moves through the funnel and measure different conversions (for example, view reporting dashboards in Monetate that may state, "For this experience, Split A shows a 10% uplift in conversion vs. the control")

Adding API Method Calls

You can add most Monetate JavaScript API method calls directly to your site or via a tag management system (TMS) anywhere within a page template.

You cannot, however, initialize the monetateQ and trackData methods using either of the aforementioned approaches.

Implement monetateQ at the top of the page template just below the Monetate tag in the <head> element of your site to ensure the object is initialized when calling other API methods.

Implement trackData at the bottom of the page template after all the content has been loaded.

Callout of the monetateQ and trackData methods in a website's code

The sample code in this screenshot shows monetateQ inserted just below the code for the synchronous Monetate tag and trackData inserted at the very bottom of the <body> element.