How to track visitors on Google Tag Manager.
Useful in two situations: you manage several client sites from one GTM account, or your website builder allows a GTM container but not raw custom code.
What you need
- • A Google Tag Manager container already installed on the website.
- • Publish rights in that container.
- • A VisitorPing site key, in the form vp_ABC23456 — the prefix vp_ and eight characters. The alphabet leaves out I, O, 0 and 1, so there is nothing to misread when copying it.
Install it
- 1
Import the template
In your workspace go to Templates → Tag Templates → New, open the three-dot menu at the top right, choose Import, and select the VisitorPing template file.
Save it.
- 2
Create the tag
Go to Tags → New and pick VisitorPing — Real-Time Website Visitor Alerts as the tag type.
Enter your site key.
- 3
Fire it on every page
Set the trigger to All Pages — Page View. Anything narrower means you only see part of your traffic.
- 4
Preview, then publish
Use GTM Preview to confirm the tag fires, then Submit and publish the container. A tag that is not published does nothing.
What you give up
GTM injects the tag through its own sandbox, which cannot mark the script cross-origin. In practice that means a JavaScript error thrown by the tracker reaches your error reporting as a bare "Script error." with no message or stack. Everything else works identically.
If the platform allows a direct script in the head, prefer that. GTM is the right answer when it does not, or when you are managing many sites at once.
What you will actually see
Per visit: the city and region the network resolves to, where the visitor came from, the page they landed on, their device and browser, and whether they have been before.
You do not get a name, an email address, or an identity. Nobody can give you that from a page view, whatever the marketing says. Geolocation resolves a network rather than a doorstep, so a visitor on a VPN or a mobile network can appear in the wrong city entirely. Treat location as a hint.
You are collecting visitor data, so say so in your privacy notice and check which consent rules apply where your customers are — a question for your own legal advice, not for a setup guide.
If it is not working
- The tag fires in Preview but not on the live site
- The container was not published. Preview runs against your workspace, not what visitors get.
- Only some pages are tracked
- The trigger is narrower than All Pages. Check it is not scoped to a URL pattern.
Find what is costing you search clicks, then watch the fix work.
VisitorPing reads your own Search Console data for the pages losing clicks, then rings your phone the moment someone lands on your website.