The calls that you implement during a baseline Monetate JavaScript API implementation are just the recommended API calls. You can implement more calls to customize your implementation to meet your business needs.
AJAX Retracking
If new information or products appear on a page without a new page load, you must retrack, or send a new trackData
request, so that the Monetate platform can re-evaluate the page. See AJAX Site Updates for more information.
Product IDs and SKUs in Method Calls
Although both product IDs (PIDs) and SKUs are required in a product catalog, you're only required to implement method calls for PIDs. However, including SKUs enhances the capabilities of both recommendations and product-badging actions.
When choosing a PID to send back to the Personalization platform, use one that is available across all pages when a product is viewed.
Baseline API Calls
Home Page
Sometimes called the landing page, the home page is the main page on your site. It's usually the first page where site visitors see when they arrive.
Method Calls
Recommended Page Type
Code Example
// Main Page Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "main" ]); window.monetateQ.push([ "trackData" ]);
Index Page
An index page lists multiple products in a grid or listing for site visitors to browse. The products on this type of page are not the result of a search performed by a visitor.
Method Calls
Recommended Page Type
index
Code Example
// Index Page Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "index" ]); window.monetateQ.push([ "addProducts", [{ "productId": "pidString1", "sku": "optionalSkuString1" }, { "productId": "pidString2", "sku": "optionalSkuString2" }, { "productId": "pidString3", "sku": "optionalSkuString3" }, { "productId": "pidString4", "sku": "optionalSkuString4" }, { "productId": "pidString5", "sku": "optionalSkuString5" } ] window.monetateQ.push([ "trackData" ]);
Search Page
A search page lists multiple products in a grid or listing that are the result of a search the site visitor performed.
Method Calls
Recommended Page Type
search
Code Example
// Search Page Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "search" ]); window.monetateQ.push([ "addProducts", [ { "productId": "pidString1", "sku": "optionalSkuString1" }, { "productId": "pidString2", "sku": "optionalSkuString2" }, { "productId": "pidString3", "sku": "optionalSkuString3" }, { "productId": "pidString4", "sku": "optionalSkuString4" }, { "productId": "pidString5", "sku": "optionalSkuString5" }] ]) window.monetateQ.push([ "trackData" ]);
Product Detail Page
A product detail page, sometimes called simply a product page, contains such key information as available sizes, colors, models, or other variations of a specific product.
Method Calls
Recommended Page Type
Code Example
// Product Page Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "product" ]); window.monetateQ.push([ "addProductDetails", [{ productId: "pidString", sku: "optionalSkuString" }] ]); window.monetateQ.push([ "trackData" ]);
Cart Page
The cart page is any page on your site on which the visitor sees what products are in their cart.
Method Calls
Recommended Page Type
Code Example
// Cart Page Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "cart" ]); window.monetateQ.push([ "addCartRows", [{ "productId": "a123", "sku": "c678", "quantity": "1", "unitPrice": "99.99", "currency": "USD" }, { "productId": "b345", "sku": "d987", "quantity": "3", "unitPrice": "29.99", "currency": "USD" }] ]); window.monetateQ.push([ "trackData" ]);
Checkout Page
The checkout page shows registered users a summary of their order details.
Method Calls
Recommended Page Type
Code Example
// Checkout Page Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "checkout" ]); window.monetateQ.push([ "trackData" ]);
Purchase Confirmation Page
The purchase confirmation page loads after a site visitor has completed a transaction.
Method Calls
Recommended Page Type
Code Example
// Purchase Page Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "purchase" ]); "window.monetateQ.push([ "addPurchaseRows", [{ "purchaseId": "73893797", "productId": "a123", "sku": "c678", "quantity": "1", "unitPrice": "99.99", "currency": "EUR" }, { "purchaseId": "73893797", "productId": "b345", "sku": "d987", "quantity": "3", "unitPrice": "29.99", "currency": "EUR" }] ]); window.monetateQ.push([ "trackData" ]);