如何获得Google Analytics(分析)& Google标签管理器可以在嵌入IFRAME中的网站上工作?
我正在尝试在我的网站上使用Google Analytics GA4和Google Tag Manager。
我的网站嵌入了另一个网站的iframe中。我看到当我浏览“网络”选项卡时,GTM已连接,但是我看不到我的标签在预期时会熄灭。当我从iframe内部删除网站时,我的标签是预期的。我正在使用窗口对象推到数据层。
推入数据层时,可以使用窗口对象在网站嵌入iframe中引起问题吗?当我的网站嵌入iframe中时,我该如何启动标签?
任何帮助或指导将不胜感激。感谢
我如何推向数据层:
window.dataLayer.push({
event: "virtualPageview",
pageName: "Page1",
venueName: window.venueName,
pageTitle: "Formyoula Page 1", //some arbitrary name for the page/state
});
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
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论