Expand my Community achievements bar.

SOLVED

double tracking in iframes

Avatar

Former Community Member

Hi everyone,

I have a question about the settings of pageviews in Adobe Analytics.
 
We've got a webpage with an iframe. The container has been implemented  with DTM and the iframe has been tagged with custom link and eVars.
 
When the page is loading, a pageview is sent (through DTM), but the iframe also sends a pageview because of its tracking code. ¿Is there any change to delete the second pageview tracking (in order to only have one) and leave the event tracking?
 
Thanks in advance!
1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi ,

You'll need to suppress second page view by adding below code to your tool custom code.

var isInIframe = (parent !== window)
if(isInIframe ){
return false; //this will prevent the Adobe Analytics tool to send a pageview image request
}else{
return true; //this will allow the Adobe Analytics tool to send a pageview image request
}

Please do let us know in case of any questions or queries.

Thanks & Regards

Parit Mittal

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi ,

You'll need to suppress second page view by adding below code to your tool custom code.

var isInIframe = (parent !== window)
if(isInIframe ){
return false; //this will prevent the Adobe Analytics tool to send a pageview image request
}else{
return true; //this will allow the Adobe Analytics tool to send a pageview image request
}

Please do let us know in case of any questions or queries.

Thanks & Regards

Parit Mittal

Avatar

Level 1

Hi Parit Mittal,

I think you will be able to help me with the following.

I have similar issue as above but the scenarios are bit different.

I have a website (Site-A) which has a third party tool as an iframe (Site-B).

Site-A using an Ensighten space called A-space. Site-B using Ensighten space called B-space. So not just pageviews but also all the events are fired 2 times (one in A-space, another in B-space) as same DataLayer object is used in both the spaces.

Note: Site B is a third party domain and I managed to add Ensighten script on their site. I can ask their developers to add/change any code for the iFrame.

Is there a way to prevent a tag from firing twice?

Let me know if you need more details.

Thanks,

Goutami