- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
11-16-2017 02:09 AM - edited 11-16-2017 04:52 AM
Hi,
I am trying to track an iframe-setting via tealium.
Our site-configuration looks like this:
main.domain.com
search.domain.com/some/path (standalone-search site)
search.domain.com/some/pathe/iframe (iframe, which is loaded on main.domain.com)
I am willing to track the standalone-search site with normal initial pageveiw tracking but I do not want to track this initial pageview for the iframe, which is loaded on main.domain.com.
This works:
// do not track iframe initial pageview if(location.pathname.indexOf('iframe')>-1){ window.utag_cfg_ovrd = {noview:true}; }
The problem is, that my other tracking code (which is in extensions) is not added to the iframe in this case.
Only if I trigger an initial function myself, the other tracking code is executed
// do not track iframe initial pageview if(location.pathname.indexOf('iframe')>-1){ window.utag_cfg_ovrd = {noview:true};
// track initial "link", to add tracking code
// why do I have to do this?
// I do not want this request setTimeout(function(){utag.link();}, 2000); }
Can someone tell me, what I am doing wrong and how I can get my expected tracking to work?
Best regards
Jan
11-17-2017 05:10 AM
I guess this one depends on the use case.
If the extension (your tracking code) scope is set to fire on Dom Ready, then it will run without the need of the code you dont want to execute.
If it can't be set to that scope becouse it should only be attached to some scope of tags, then it needs a diferent approach.
Here is one that I manage to set working:
Now the calling code should call only that TAG with ID 32 and should send the UDO "isIframe" = true
Here's an example using your code snippet:
if(location.pathname.indexOf('iframe')>-1){ window.utag_cfg_ovrd = {noview:true};
// track initial "link", to add tracking code
// why do I have to do this?
// I do not want this request //setTimeout(function(){utag.link();}, 2000);
setTimeout(function() {
utag.link({
"isIframe": "true"
},
null,
[32]); // MAKE SURE this points to your NEW TAG ID, in my example 32
}, 2000); }
11-20-2017 04:10 AM
Depending on the scope of the extension and when it needs to fire.
What you could do is use the Before Load Rule scope for the extension.
This will still run the extension even if the noview override is set.
Adrian
11-21-2017 02:33 AM
11-21-2017 02:43 AM - last edited on 11-21-2017 07:28 AM by kathleen_jo
There is no problem with my extension. It is executed as expected.
The problem is, @adrian_browning, with the tag, which only "load"s (as Tealium Web Companion says), but it won't execute the code until I manually (or with another extension) execute utag.view() or utag.link().
So I will get an additional pageview (or event) request, which I want to avoid.
The last solution in my mind would be to alter the template code of my tag, to avoid it executing on the iframe domain.
Copyright All Rights Reserved © 2008-2023