使用标签管理器获得确切的位置

发布于 2025-01-21 18:41:55 字数 116 浏览 2 评论 0原文

当用户从Android设备查看网页中,是否可以从Google标签管理器中获取精确的位置(纬度/经度)?

理想情况下,我可以在GTM中进行设置。如果可能的话,有人可以解释如何做吗?

非常感谢!

Is it possible to get exact location(latitude/longitude) from Google Tag Manager, when user from android device view web page?

Ideally, I would be able to set-up this up in GTM. If it is possible, can someone please explain how to do it?

Thanks so much!

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

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

发布评论

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

评论(1

梦在深巷 2025-01-28 18:41:55

在GTM中,您可以在其中使用< script>部署自定义的HTML标签,并在每个页面视图上启动它。现在,您的问题完全消除了GTM因子。另外,您可以使用CUSTM JS变量来获得长/lat。

现在,它是关于使用JS跟踪用户位置的,该解决方案有许多解决方案,其中一种在评论中引用了Eike。

请记住,广告阻滞剂阻止GTM,因此您的地理定位脚本将不适用于具有广告阻滞剂的用户。另一方面,如果您直接部署地理位置脚本,除非它们直接阻止地理定位脚本,否则它将不会取决于广告阻滞剂。

简而言之,除非您只需要长/lat用于跟踪目的,否则不要为此使用GTM。否则 -

In GTM, you can deploy a custom HTML tag with a <script> in it and make it fire on every pageview. Now your question completely removes the GTM factor from it. Alternatively, you can use a Custm JS variable to get your long/lat.

Now it's about tracking user location with JS, which there are many solutions to, one of which Eike referenced in the comment.

Keep in mind that ad blockers block GTM, so your geolocation script will not work for users with ad blockers. On the other hand, if you deploy the geolocation script directly, it will not be dependent on ad blockers unless they block the geolocation script directly, which they don't tend to do.

In short, unless you only need long/lat for tracking purposes, don't use GTM for it. Otherwise -

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