I am trying to use Google Analytics GA4 and Google Tag Manager on my website.
My website is embedded in an Iframe inside another website. I see that GTM is connected when I look through the network tab but I do not see my tags firing off when expected. When I remove the website from within the Iframe my tags fire as expected. I am using the window object to push to the data layer.
Could using the window object when pushing to the data layer cause issues when the website is embedded in an Iframe? How can I have my tags fire off when my website is embedded in an Iframe?
Any help or guidance would be greatly appreciated. Thanks
How I am pushing to data layer:
window.dataLayer.push({
event: "virtualPageview",
pageName: "Page1",
venueName: window.venueName,
pageTitle: "Formyoula Page 1", //some arbitrary name for the page/state
});