- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
05-23-2018 01:41 AM
Hi,
I am wondering if a built-in mechanism exists in Tealium to queue events. Much like Google Analytics, I would love to be able to just add events to a queue (a simple JS object array) that Tealium will pick up and process once it is fully loaded.
On our sites, we have stuff happening before Tealium is loaded. And we want to track those things, but we can't do a utag.link() for example, because utag doesn't exist yet at that point. We can of course write our own queue logic, but I was wondering if something like that is available out of the box.
Thank you !
Filip
Solved! Go to Solution.
06-05-2018 12:35 AM
Hi @filip_lejon
I would like to have that as well, but I think there is no "out of the box" solution from tealium. I created a queue logic on my own. So I gatter all events in a JS Object Array, and on DOM Ready I fire utag.link with the values in the JS Object (if it's not empty).
Kind Regards
Patrick
06-05-2018 03:25 AM
06-06-2018 12:20 AM
If not, maybe it's a post on "tealium product ideas" worth ;)
https://community.tealiumiq.com/t5/Product-Ideas/idb-p/product-ideas
06-06-2018 07:26 AM - edited 06-06-2018 07:27 AM
Hello @PatrickHegnauer and @filip_lejon I am trying to get @adrian_browning here to address this post. He is quite the busy man, however, so give me a sec. #ThankYouForYourPatience
06-07-2018 02:07 AM
Hi @PatrickHegnauer and @filip_lejon
Out of the box, utag doesn't have this functionality, unfortunately.
However, that being said if you are able to either:
Then a solution can be created. I would highly recommend adding to the Product Ideas board to have this baked into the product.
If you would like to learn more I can do a quick write up for you, on how you would go about this.
Adrian
06-07-2018 02:11 AM
@adrian_browning Thanks for your insights, I would love to see a quick write up, on how to go with this.
Kind Regards
Patrick
06-21-2018 08:33 AM
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
Copyright All Rights Reserved © 2008-2023