Method Calls

addPollForElement

addpollforelement method // addpollforelement method window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\["addpollforelement", "selector string" ]) window\ monetateq push(\["trackdata"]); the addpollforelement method is used to add a delay to the trackdata call until some element on the page exists this method is useful if you added calls to the monetate javascript api in the page \<head> element with the baseline implementation 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 addpollforelement before you call trackdata you can pass any valid css selector as the second parameter in addpollforelement when the polling function completes successfully, it's deleted and isn't evaluated again on subsequent page retracks unless you add another call to addpollforelement addpollforelement polls 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 code sample addpollforelement example // addpollforelement example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\["addpollforelement", "#topnav subnav span" ]) window\ monetateq push(\[ "trackdata" ]);