Monetate JavaScript API FAQ
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.
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.
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.
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 Method Calls and Monetate Features Unlocked for features and their corresponding API methods.
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.
You can send the monetateQ object 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.
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.
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.
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.
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.
The addConversionRows method generates a purchase ID. The addPurchaseRows method uses a product catalog's internal purchase ID.
After you create a product catalog schema, you can update a product catalog using the Monetate Data API.
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.
An eCommerce connector allows you to easily pass data to the Monetate JavaScript API through your eCommerce provider's platform.
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 .
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.
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.
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 .
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 .
Any change to the file structure, script library, or any other deviation from the typical platform implementation is considered a customization.
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.
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.
The Monetate tag alone doesn't allow you to track conversions, behavioral interactions, or site structure (for example, page types). These are incredibly important when you implement any personalization program. Use Monetate JavaScript API method calls to unlock full functionality.
See Method Calls and Monetate Features Unlocked for a complete list of things you can do on your site and related requirements.
Each domain or account in your contract receives two tags: a production tag and a development tag. Both tags function exactly the same way with one exception: The development tag does not store historical data.
Because the development tag does not store historical data, the platform does not collect analytics for development accounts.
Use the development tag in all lower environments where you want to use Monetate so that you do not use the production tag in an environment that doesn't have real user traffic. You can easily copy any work on experience or action development from tag to tag as well, so there's no duplication of effort if you prefer to build experiences in a lower environment for testing before moving them to production.
Monetate evaluates experience and action eligibility on each trackData call that is made on a page. Typically this call is deployed natively on the page and triggered on each page load. If you need to serve content adjustments without a page load, you must add a retrack.
Retracks are used to send page updates to Monetate that may occur without a new page load.
Here are the steps of a retrack:
- Push relevant API methods into that object, such as setPageType, addProductDetails, or addCartRows.
- Send data to Monetate using trackData.
The following are some common scenarios and retrack solutions:
- For an Add to Cart button that adds an item without triggering a page load, use addCartRows in a retrack to pass cart details
- For a Quick View button that shows product details without triggering a page load, use addProductDetails to pass product details
- When updates to item color or size selections on a product details page don't trigger a new page load, use addProductDetails to pass updated product details
- For a single checkout page that calls new forms onto the page (typically using AJAX) without triggering a new page load, use setPageType for cart, shipping, and billing pages
- For a lazy-loading index page on which new products are called onto the page, trigger addProductDetails to send all product IDs now present on the page on scroll
The monetateQ object is emptied on each trackData call, so you must include all relevant API methods to pass the page attributes you want to evaluate in the trackData call.
Each trackData call made to Monetate through the API or a custom integration built by Monetate registers as a page view. (It also triggers the viewPage event in the Monetate Inspector tool.) Therefore, if more than one trackData call happens on a single page, page views may be inflated in the platform's internal analytics.
You can use an optional {'nonPageView': true} parameter for the trackData call to prevent it from counting as a page view.
The optional {'nonPageView': true} parameter defaults to false.
See Page Retracks for more information about retracks.
A rollback is functionality that can be added to a domain implementation that removes actions that have already been served to a page when a retrack occurs without triggering a new page load. It rolls back the action from the page.