- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
09-11-2017 03:51 PM
Hello,
I have a use case where I need to use the option "waittimer" and set it to 3s. Last item in the documentation found here :
https://community.tealiumiq.com/t5/JavaScript-utag-js/Config-Overrides-for-utag-js/ta-p/14048
As far as I understand it's a global option. My questions are :
1. What's the downside of using this option? - e.g. if the visitor leaves the webpage before 3s - my bounce rate will be incorrect? or it will slow down the load time of the page?
2. How can it be used with Adobe Target - does it mean the Target will load the page and then - reload the page (async) or slow down the page loading (Sync) mode?
3. I have played around with dom_complete = true -- but it doesn't seems to do anything different - I thought dom_complete will load "all" external assets file etc - maybe I am not using it right.
I am keen to understand the negetive aspect of overriding waittimer, I am in a legacy enviornment - so my utag_data doesn't get the time to get populated before utag fires - I have managed to halt utag using waittimer - but I want to understand the downside of it.
Many thanks.
Solved! Go to Solution.
09-26-2017 06:37 AM
Hi @zhaque
Adrian
10-20-2017 01:40 AM
10-30-2017 03:47 AM - edited 03-06-2018 11:58 AM
Sorry for the delay, back from holiday now.
My suggestion to do this would be:
The important tags have a rule that says something like window_ready !== true
Less important tags have an additional rule that says something like window_ready === true
Any future tags that are added will need to have one of these 2 load rules assigned. Else you will get double firing, due to them to "open".
Preloader Extension
window.utag_data = window.utag_data || {}; window.utag_data.window_ready = "false";
Now in a DOM Ready Extension
(function(){
var RH,
hasBeenCalled = false,
callUtag = function(){
if (!hasBeenCalled) {
hasBeenCalled = true;
utag.data.window_ready = "true";
utag.view(utag.data);
}
};
if (document.readyState === "complete") {
callUtag();
} else {
if (document.addEventListener) {
RH = function () {
document.removeEventListener("DOMContentLoaded", RH, false);
callUtag();
}
window.addEventListener("load", callUtag, false);
} else if (document.attachEvent) {
RH = function () {
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", RH);
callUtag();
}
};
document.attachEvent("onreadystatechange", RH);
window.attachEvent("onload", callUtag);
}
}
}());
I would recommend this, over calling utag.pre();
and utag.loader.initcfg();
manually.
Adrian
Copyright All Rights Reserved © 2008-2023