iframe window.utag_cfg_ovrd.noview = true

jan_daniel_herg
Visitor
jan_daniel_herg

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

 

4 REPLIES 4
Highlighted

iframe window.utag_cfg_ovrd.noview = true

Tealium Employee

Hi @jan_daniel_herg

 

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:

 

  • Created a new UDO variable called "IsIframe"
  • Created a new Load Rule called "Load on Iframes" with condition if UDO.isIframe = true
  • Add a new Tealium Custom Container Tag
    • nothing will fire if unchanged
    • this new tag has an ID of 32
    • make sure the tag fire on "link" calls by changing this line u.ev = {'view' : 1,}; to this u.ev = {'view' : 1, 'link' : 1}; on the new tag template.
  • Changed the extension (your tracking code) and added the new tag on to its scope.

 

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); }

 

 

 

iframe window.utag_cfg_ovrd.noview = true

Tealium Employee

@jan_daniel_herg

 

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

Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

iframe window.utag_cfg_ovrd.noview = true

jan_daniel_herg
Visitor
jan_daniel_herg

Unfortunately my tag is only "loaded", not "ok".
I have to fire utag.view() or utag.link() to make it to status "ok"

iframe window.utag_cfg_ovrd.noview = true

jan_daniel_herg
Visitor
jan_daniel_herg

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.