'get exact location with tag manager
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!
Solution 1:[1]
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 -
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
