Push Function for Asynchronous Tracking
- 1 Minute to read
- Print
- DarkLight
Push Function for Asynchronous Tracking
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Always use the push functionality when calling the Smart Pixel, because the script is loaded asynchronously to avoid performance issues.
/**
* @param {function(wtSmart)} fn
*/
wtSmart.push(fn);
Example
window.wtSmart = window.wtSmart || [];
window.wtSmart.push(function(wtSmart) {
// set initial tracking config
wtSmart.init.set({
trackId: '111111111111111',
trackDomain: 'q3.webtrekk.net'
});
// set page data
wtSmart.page.data.set('en.index.home');
// send tracking data and remove data after request
wtSmart.track();
});
Was this article helpful?