Page Retracks
monetate tracks and evaluates dom content included only in the initial page load content by default after this initial track, if any content is served to the page through ajax or if the page changes state asynchronously to display new data, then you must perform a retrack to make the platform aware of the new data present a retrack is not a separate function it's a new set of method calls to send a new track to the monetate platform every retrack must include the following populating the baseline api call matrix object new content (if applicable) by using appropriate method calls based on the new context of the page send the trackdata request when you perform a retrack, you must always resubmit all the data in the monetateq object (for example, the page type), even if that data hasn't changed retrack best practices consider the following best practices when you use retracks on a page don't tie retracks to events that would exceed the rate limit of 27 per minute consider defining a page category of retrack with addcategories so you can exclude actions from running on retracks retrack examples here are some instances when a retrack may be necessary included with each example is the initial track and then the retrack items added to cart if a customer adds an item to the cart from an index, search, or product page and is not sent to the cart page, then you can send a new track that includes the cart information in the first code sample, a customer adds an item from the product page, and an add to cart modal appears initial track example // initial track example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "setpagetype", "product" ]); window\ monetateq push(\[ "addproductdetails", \["a123"] ]); window\ monetateq push(\[ "trackdata" ]); now that an item is in the cart, you must alert monetate by sending a new track with the page context and the cart contents retrack example // retrack example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "setpagetype", "product" ]); window\ monetateq push(\[ "addproductdetails", \["a123"] ]); window\ monetateq push(\[ "addcartrows", \[{ "productid" "a123", "quantity" "1", "unitprice" "99 99", "currency" "usd" }] ]); window\ monetateq push(\[ "trackdata" ]); filter used on index or search page a filter is triggered on the product index page but doesn't refresh the page therefore, you must add a retrack to the page template after the filter code to push the updated state of the page to monetate and get instructions for modifications to the page based on this new data initial track example // initial track example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "setpagetype", "index" ]); window\ monetateq push(\[ "addproducts", \["a123", "b456", "c789"] ]); window\ monetateq push(\[ "trackdata" ]); retrack example // retrack example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "setpagetype", "index" ]); window\ monetateq push(\[ "addproducts", \["d123", "e456", "f789"] ]); window\ monetateq push(\[ "trackdata" ]); quick view modal on index or search page a customer opens a quick view modal, which displays a product's details, on the product index page therefore, you must add a retrack to the page template to fire after the quick view modal appears initial track example // initial track example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "setpagetype", "index" ]); window\ monetateq push(\[ "addproducts", \["a123", "b456", "c789"] ]); window\ monetateq push(\[ "trackdata" ]); to register the quick view modal as a product view, send the addproductdetails call, as shown in the following code sample retrack example // retrack example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "setpagetype", "quickview" ]); window\ monetateq push(\[ "addproductdetails", \["a123"] ]); window\ monetateq push(\[ "trackdata" ]); testing retracks once you have triggered a retrack, you can test it to ensure it works first, put your web application in the state in which you expect it to display the action(s) that you built, and then paste the lines of code into the javascript console the actions should download in the retrack and run successfully you can also use the monetate inspector browser plug in to see additional tracks recent updates to safari intelligent tracking prevention (itp) block third party cookies on your site this update means that preview mode and the monetate inspector browser plug in may not work in safari monetate has developed an alternative approach to delivering preview mode to the site to have this option enabled for your account, submit a support ticket using the {{monetatesupportcontact}} no workaround exists at this time for the inspector tool instead, use a different browser such as chrome if you need to use monetate inspector launch monetate inspector while you're on a page that you know has an ajax operation, such as a change in search terms next, perform the ajax operation while on the track tab in the plug in tool callout of the track tab in monetate inspector after you initiate the ajax operation, the track count should increase by one in this screenshot the track count has changed from track 3 , shown in the previous screenshot, to track 4 callout of the track selector in the monetate inspector, which is set to track 4 once you see the additional track added to the track selector, you know that the retrack works and then can close monetate inspector retracks and the average page view metric each trackdata call made to monetate through the api or a monetate built implementation registers as a page view therefore, if more than one trackdata call happens on a single page, page views may be inflated in the monetate 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 example track with nonpageview parameter // example track window\ monetateq push(\[ "trackdata", { "nonpageview" true } ]);