@PatrickHegnauer
Credit to one of our former colleagues Brian Kranson for this:
//Inline on the page (function(t,e,a,l,i,u,m){
if(t.utag)return;e=t.utag={};e.e=[];
e.view=function(a,b,c){e.e.push({a:a,b:b,c:c,d:"view"})};
e.link=function(a,b,c){e.e.push({a:a,b:b,c:c,d:"link"})};
e.track=function(a){e.e.push({a:a.data,b:(a.cfg?a.cfg.cb:null),c:(a.cfg?a.cfg.uids:undefined),d:a.event})};
}(window));
// Very first preloader code
// put the utag_events into the window scope as utag_events
// then delete utag so that the utag.js will build up as needed
(function(w){
if(typeof w.utag !== 'undefined' && typeof w.utag.e === 'object'){
w.utag_events = w.utag.e;
delete w.utag;
}
}(window))
// DOM Ready Extension
// loop through the window level array utag_events and call utag.track as necessary // utag.track will use the view or link or any event as well as the callback or list of tag ids
(function(w){
if((typeof w.utag_events === 'object' && w.utag_events.length > 0)){
while(w.utag_events.length){
d=w.utag_events.shift();
(function(d){
setTimeout(function(){
utag.track({
event: d.d,
data: d.a,
cfg: {
cb: d.b,
uids: d.c
}
});
}, 150);
})(d);
}
}
}(window))
Adrian
... View more