Skip to main content
Jun 14, 2017 8:42 PM UTC
Solved

Setting up a DTM code in an iframe

I am trying to setup a DTM within a website that is built with the body in an <iframe>. What is the best way to get this setup so that it fires properly? Any help with this is much appreciated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ParitMittal
ParitMittalAccepted solution
Level 10
Jun 15, 2017 7:51 AM UTC

Hi ,

To  Successfully track the iframe page You just need to add the same DTM Header & Footer code (that you have on parent page) to iframe page and yes, there will be multiple server calls and you'll need to suppress one by adding this 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
}

Thanks & Regards

Parit Mittal

2 replies

ParitMittal
ParitMittalAccepted solution
Level 10
Jun 15, 2017 7:51 AM UTC

Hi ,

To  Successfully track the iframe page You just need to add the same DTM Header & Footer code (that you have on parent page) to iframe page and yes, there will be multiple server calls and you'll need to suppress one by adding this 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
}

Thanks & Regards

Parit Mittal

Translate
Jun 11, 2018 6:44 AM UTC

Hi Parit,

We have a parent jsp page which is calling another jsp( that has iframe content to it).

Can we add adobe tag management container to iframe? If yes, how?

Please reply.

Thanks,

Shubhi.

Translate