- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
11-01-2019 08:14 AM - edited 11-01-2019 09:33 AM
Hi everyone,
I'm trying to fire a tag based on a JavaScript interaction. I tried using utag.view() and utag.link() to get this, but the tag is not being fired.
This is what I did:
utag.link({}, function(){ console.log('******* TAG LOADED ********'); }, [1754]);
In this case, I didn't configured a Load Rule for the Tag, for that reason it was configured "All Pages" by default. So, I was expecting to see the Tag fired twice, but I see it only one.
I also tried this:
utag.link({'attrib_01': 'oscar'}, function(){ console.log('******* TAG LOADED ********'); }, [1754]);
In this case I expected to see it fired only once, but I get none.
One more thing, in all cases the callback function is always fired.
Best regards,
11-01-2019 10:22 AM
11-02-2019 08:38 AM - edited 11-02-2019 08:56 AM
Great tip!
This is what I'm getting:
But I'm confused, I'm not sure if the message "called before tags loaded" is part of Tag 1754 or Tag 1597.
Also, I looked for a solutions to that message and I found this post: https://community.tealiumiq.com/t5/Tealium-iQ-Tag-Management/utag-view-not-firing-on-additional-page...
I tried the solutions they provided, but what I get is after several seconds "utag.handler.iflag" still having a 0 value.
This is the Tag configuration:
Thanks!
11-03-2019 09:36 PM
Finally, I found a way to make the Tag work. What I found is the Tag was loading but "u.send()" was not being executed. So, the solution I found is to call it from the "utag.view" callback function:
setTimeout(function() { if (typeof utag_data.tag_id_onload !== 'undefined') { utag.view({}, function(){ utag.o['my-profile'].sender['1755'].send('view'); }, ['1755']); } }, 200);
Is this the right way to make it work?
Thanks!
11-06-2019 03:11 AM
Hello @oscarmartinezm
While this may work, it is circumventing an actual issue with your current setup, the error message "tag did not load" is suggesting that there is an issue with this tag file, typically a syntax error in the tag.
This error would likely be preventing all "utag view/link" calls being made on the page (ignoring the default page view when utag.js loads)
I would suggest looking in to the tag template for 1597, or looking at utag.1597.js when it is loaded in your webpage try to try and identify where the issue in this tag is coming from.
If you can fix the issue with this tag, it should allow for 1755 to fire when you are calling it
Copyright All Rights Reserved © 2008-2023