addPollForElement method is used to add a delay to the
<head> with the Monetate tag. This configuration could cause track to occur before a page loads, resulting in actions that don't execute on the page.
Before implementing the
addPollForElement method, be aware of these additional considerations:
- If you want to delay track with polling, you must call
addPollForElementbefore you call
- You can pass any valid CSS selector as the second parameter in
- When the polling function completes successfully, it's deleted and isn't evaluated again on subsequent retracks unless you add another call to
addPollForElementpolls every 50 milliseconds for 5 seconds or until the designated element is found. Monetate tracks regardless of whether the element is found or the poll times out.
// addPollForElement Method window.monetateQ = window.monetateQ || ; window.monetateQ.push(["addPollForElement", "selector string" ]) window.monetateQ.push(["trackData"]);
// addPollForElement Example window.monetateQ = window.monetateQ || ; window.monetateQ.push(["addPollForElement", "#topNav .subnav span" ]) window.monetateQ.push([ "trackData" ]);