Monetate JavaScript API FAQ


How safe is the Monetate tag for the rest of my site?

Both the asynchronous and synchronous versions of the Monetate tag and all other static assets, including actions and assets uploaded to the Monetate platform, are all built automatically and served from the Akamai content delivery network (CDN). Akamai uses its own private fiber links to distribute this content around the world to its edge locations. Its redundant DNS system directs a visitor to the nearest location.

The following scenarios describe what happens if Akamai experiences an outage:

  • If Akamai nodes malfunction, then they're taken out of the rotation. A site visitor still receives the Monetate tag but from another location.
  • If the entire Akamai DNS malfunctions, then the DNS query fails and the browser continues to load the rest of your site.
  • If an Akamai node isn't taken out of the rotation but is unreachable or refuses connections after a malfunction and the failover system hasn't noticed it yet, the node returns an error code and the rest of the site loads normally.

Only two failure modes could result in your site potentially hanging in a site visitor's browser. The first occurs when the DNS query works, and the allocated Akamai node is still functioning and accepts connections but fails to return any content. The second could occur when a firewall drops connections to this host, but Akamai is used for a significant portion of online services. To date Monetate hasn't observed either of these failure modes within Akamai's systems.

Akamai delivers a worldwide (and in many instances, redundant) service, and any failure on its part would actually prevent many high-profile sites (including a portion of other tags and services that are on your site) to stop functioning as well.

What value does the Monetate JavaScript API offer?

The Monetate JavaScript API is an open-source library of methods that pass data from your site to Monetate and enable a more robust set of core features.

What is an API call?

An API call is a method with custom properties that passes data from your page to Monetate.

Where should I install the Monetate JavaScript API?

You can install the Monetate JavaScript API method calls in a number of places within your contracted domain(s), but you must decide where you want them configured. Monetate recommends a use case–driven approach to determine what data you want to pass to the Monetate platform.

For example, the addCartRows method passes the products that a customer adds to the cart to Monetate. Passing this information then lets you target customers who have in the cart a specific product or one or more products from a specific product category.

Do I need to use every method in the Monetate JavaScript API?

No, you don't. You only need to implement the API methods for the Monetate features that you want to use on your site. Refer to the table in What Do You Want to Do on Your Site? for features and their corresponding API methods.

Is the monetateQ object persistent?

No, it isn't. The monetateQ object must be defined on every page. Furthermore, any values pushed into the object are sent to Monetate and cleared once a trackData call occurs.

How does the clearing of the monetateQ object impact variables defined within the object?

You can send the monetateQ method properties and values to Monetate multiple times on a page. However, ensure that any methods you use are defined and resent with each trackData call because the monetateQ object is emptied after each trackData call.

What does trackData do when data passes to Monetate?

Each instance of trackData on your site's page sends the contents of the monetateQ object that are defined by each of your site's API calls to Monetate.

Can I use multiple trackData calls on a page?

You can use multiple trackData calls on a page. However, doing so is only necessary for specific use cases in which content doesn't exist on the page when the initial call to trackData occurs.

Multiple trackData calls on a page are known as retracks. Any time you use multiple trackData calls on a page, you should populate other methods previously defined so that monetateQ data is complete and consistent.

For example, you want to create a custom target using Target Builder, but the HTML element that you want to use doesn't exist on the page during the initial page load. To create this custom target, you can add a retrack to the page that takes place after the element you want to use exists on the page.

When should I send addCartRows multiple times?

The data passed to Monetate with the addCartRows method must match the products in the cart during each trackData call to facilitate accurate targeting. For example, if a customer removes a product from the cart, then your site must call addCartRows again followed by another call to trackData to pass the updated list of products in the cart.

What is a mini cart collect?

A mini cart is a persistent cart that tracks items on pages of a site that aren't the cart page itself. A mini cart collect occurs when your site populates the addCartRows method on each page on which the mini cart appears. A mini cart collect allows for additional targeting and conditional statements within Monetate.

What's the difference between addConversionRows and addPurchaseRows?

The addConversionRows method generates a purchase ID. The addPurchaseRows method uses a product catalog's internal purchase ID.

How do I send Monetate a product catalog if I'm using the Monetate JavaScript API?

After you create a product catalog schema, you can update a product catalog using the Data API.

Monetate and eCommerce Connectors

To a certain extent, eCommerce connectors and the Monetate JavaScript API are similar. The Monetate JavaScript API is a series of method calls that pass data from your site to Monetate and is required for the Monetate platform to work. An eCommerce connector is open-source baseline code that configures the Monetate JavaScript API on your platform.

What value does an eCommerce connector offer?

An eCommerce connector allows you to easily pass data to the Monetate JavaScript API through your eCommerce provider's platform.

Should I use the API or an eCommerce connector to pass my data to Monetate?

The method you use depends on your site's eCommerce platform. Monetate generally recommends using the API to implement your site, but you may be able to use a connector if you're using the default configuration of your platform. Otherwise, stick to the Monetate JavaScript API to pass data to the Monetate platform. For more information contact your Services representative or submit a support ticket using the Monetate Technical Support portal (

Does Monetate perform any quality assurance measures on my site's Monetate JavaScript API or connector implementation?

No, Monetate doesn't perform any QA work for the data you pass through the Monetate JavaScript API or eCommerce connector. However, it can assist you with general troubleshooting for Monetate JavaScript API issues. You must manage any QA work internally. See QA Pages to learn about QA best practices.

What does the Monetate tag do?

When you place the Monetate tag on your site, either manually or with an eCommerce connector, it fetches the script to execute Monetate's functions and features on that site. You can then configure the Monetate JavaScript API and your eCommerce connector to pass data back to Monetate with that script.

I don't see my eCommerce platform. Can I still use it with Monetate?

You potentially might be able to do so. Monetate has developed several eCommerce connectors with partners. If your platform doesn't currently have a connector, then you must use the Monetate JavaScript API. For more information contact your Services representative or submit a support ticket using the Monetate Technical Support portal (

Whom do I contact about any issues I encounter while using an eCommerce platform connector?

All the Monetate eCommerce platform connectors are built on a standardized implementation of your eCommerce platform. If you have trouble installing the connector, check with your systems integrator to verify if any customizations were made to your implementation. If you continue to have trouble, submit a support ticket using the Monetate Technical Support portal (

What qualifies as an eCommerce platform connector customization?

Any change to the file structure, script library, or any other deviation from the typical platform implementation is considered a customization.

Can Monetate implement the eCommerce platform connector on my platform?

No, it cannot. Monetate can complete the process of adding the relevant method calls to your site for an additional fee, but it cannot utilize an eCommerce platform connector for you.

How often does my eCommerce platform connector generate and send a product feed file to Monetate?

You can configure eCommerce platform connectors with the option to automatically provide product feed files to send the product feed as frequently as you want.