将DOM元素推到Datalayer

发布于 2025-02-11 02:04:07 字数 182 浏览 2 评论 0原文

我是新手使用Google标签管理器的新手。

我希望能够捕获页面正文中显示的电子邮件。我能够通过创建一个DOM元素变量来捕获这一点。

我希望能够在GA4中看到电子邮件的值。有什么方法可以将DOM元素推向数据层?

还是有一种方法可以使用Datalayer捕获页面底部显示的电子邮件?

感谢您的帮助。

I'm new to using Google Tag Manager.

I want to be able to capture the email displayed in body of the page. I was able to capture this by creating a DOM Element variable.

I want to be able to see the values of the emails in GA4. Is there a way I could push the DOM element to the DataLayer?

Or is there a way to capture the emails displayed in the bottom of the page thru using the DataLayer?

Thanks for your assistance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

耶耶耶 2025-02-18 02:04:07

有很多方法可以这样做。
最好的方法可能是创建一个自定义的HTML标签,该标签将页面加载上的元素删除并将其推向Datalayer。

可以共享网页URL吗?这样,我可以与您共享一些示例代码。

There are many ways to do so.
The best way would probably be to create a custom HTML Tag, that scrapes the elements on page load and pushes these to the DataLayer.

Can share the webpage URL? This way I could share some example code with you.

深海不蓝 2025-02-18 02:04:07

您可以首先为电子邮件配置变量,然后尝试将其推到tag(custichtml)

<script type="text/javascript">
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push( email : {{your email variable}} )
</script>

其他方法中,如果您设置了actairable >已经。您可以将其在GA4标签中配置为用户属性

,但请记住,GA4不允许您将PII信息发送到GA4,例如电子邮件和其他用户个人信息。

?如果您确实需要,则需要考虑其他工具来收集电子邮件。

You can configure a Variable first for the email and try to push it to datalayer in the Tag (CustomHtml)

<script type="text/javascript">
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push( email : {{your email variable}} )
</script>

Other way is if you set the Variable already. You can just configure it in your GA4 tag as an User Property

But please remember GA4 is not allow you to send the PII information to GA4 like email and other user personal information.

Google Document

So you might need to consider other tool to collect the email if you really need it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文