- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
11-28-2016 08:33 AM
Is there a way to force specific tags to fire after specific pageloading stages? dom.complete, dom.ready, etc?
I have some tags that on some pages i'd want to fire immeadiately on pageload, whereas on other pages or other tags I'd want to fire after pageload is complete (or at least later than inital pageload process).
11-28-2016 04:38 PM - edited 11-29-2016 09:54 AM
Out of the box, all Tags loading via Tealium will fire at DOM Ready.
You can change this setting to DOM Complete, but you cannot have both DOM Ready and DOM Complete, you gotta pick one. You will want a JavaScript Extension scoped to PreLoader with the following code:
window.utag_cfg_ovrd = window.utag_cfg_ovrd || {}; utag_cfg_ovrd.dom_complete = true;
Now that said, there is one other setting called the wait flag which is set on a tag by tag basis. For each tag where the wait flag is no, that tag will load as soon as possible and will not wait for DOM state to change.
You can read more about the override flags here: https://community.tealiumiq.com/t5/Browser-utag-js/utag-Config-Overrides/ta-p/14048
You can read more about the wait flag in the Advance Settings section of: https://community.tealiumiq.com/t5/Tealium-iQ-Tag-Management/Tags/ta-p/5016#toc-hId--1470671774
11-30-2016 11:44 AM - last edited on 12-01-2016 10:22 AM by kathleen_jo
Thanks @brian_kranson! very helpful!
12-05-2016 01:02 PM
Hi @brian_kranson,
Is there any way to have a tag load prior to dom.ready if desired?
12-06-2016 01:17 AM
Your best bet to run the tag before DOM Ready would be to turn the wait flag off.
If you use this, you need to make sure all data that you want to send if ready by the time utag loads and fires the tag.
Regards,
Adrian
Copyright All Rights Reserved © 2008-2023