Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

Setting up a DTM code in an iframe

Avatar

Level 1

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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

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

Avatar

Level 1

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.