Suppressing Page view from iframe | Community
Skip to main content
sanmeetw1519854
New Participant
May 28, 2019
Solved

Suppressing Page view from iframe

  • May 28, 2019
  • 1 reply
  • 1787 views

Hi,

One of our clients is showing iframe of other contents of the site if users hover over certain sections. As a result of this, the iframe is causing sencondary page load calls on top of the primary call for the page on which the iframe is hosted.

I want to suppress this call. We are using DTM. Any ideas how this can be done?

Sanmeet

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Urs_Boller

we have the same setup, here's our solution (for the DTM property in the iFrame)

1) create a data element "in iFrame" which returns "yes" or "no". check by Javascript if the page is loaded in an iFrame. possible code see here: https://tommcfarlin.com/check-if-a-page-is-in-an-iframe/

2) in your page load rule add a new condition like "in iFrame = no"

this setup should stop tracking the pageload within the iFrame.

1 reply

Urs_Boller
Urs_BollerAccepted solution
New Participant
May 28, 2019

we have the same setup, here's our solution (for the DTM property in the iFrame)

1) create a data element "in iFrame" which returns "yes" or "no". check by Javascript if the page is loaded in an iFrame. possible code see here: https://tommcfarlin.com/check-if-a-page-is-in-an-iframe/

2) in your page load rule add a new condition like "in iFrame = no"

this setup should stop tracking the pageload within the iFrame.