Each array in the monetateQ
array contains instructions to add data that Monetate tracks. The first index of each array is the method name. The most common method is setPageType
, which is required in every monetateQ
array to indicate the type of page that the customer is viewing.
All data is sent asynchronously to Monetate by calling the trackData
method. This method takes no arguments. It can be called whenever data is ready to be sent to Monetate.
Code Example | Tips |
---|---|
// Example window.monetateQ.push([ method, data ]); | Add the monetateQ array in the page template directly after the Monetate tag. |
// setPageType Method window.monetateQ.push([ "setPageType", "main" ]); | The trackData method sends data to Monetate. Place it at the bottom of the page after all other content has been loaded and relevant information has been added to monetateQ . |
// trackData Example window.monetateQ = window.monetateQ || []; window.monetateQ.push([ "setPageType", "main" ]); window.monetateQ.push([ "trackData" ]); | When you call trackData more than once because major elements or content on the site have changed (for example, on a single-page application), you must resend all the data to Monetate, including the page type. |