If your site already uses Google Tag Manager, GTM is the cleanest place to load the Personyze tracking tag — you avoid editing site templates, you can deploy/rollback through GTM versioning, and changes don’t require a developer push.
Prerequisites
- GTM container installed on your site
- Personyze Site ID (find it in Settings → Domains and Tracking, look for the
S_Tnumber in your tracking snippet) - The Personyze Tracking Code tag template imported from the Google Tag Gallery (search “Personyze” in GTM’s Tag Templates browser)
Step-by-step setup
- Add a new tag. In your GTM workspace, click Tags → New.
- Choose the Personyze template. Click the tag-config area, then select Personyze Tracking Code from the gallery.
- Enter your Site ID. Paste the
S_Tnumber from your Personyze account into the Site ID field. - Set the trigger. Use All Pages for standard sites. For single-page applications, use the Page View trigger only — never History Change. See the SPA note below.
- Publish. Save the tag, then Submit a new GTM version with a clear description (e.g., “Add Personyze tracking tag”).
Where to load the tag
We recommend firing Personyze as early as possible in the page execution path — ideally in Page View rather than waiting for DOM Ready or Window Loaded. Earlier firing means Personyze has more time to:
- Identify the visitor against their existing profile
- Resolve audience matches
- Render any personalization that needs to display before the user starts scrolling
Late-firing tracking causes a visible “flash of original content” on personalized pages, which we want to avoid.
pushState, which conflicts with Personyze’s own SPA detection (see One-Page Applications). Use a Page View trigger only — Personyze handles SPA route changes internally. This is documented in Google’s Page View trigger article too.Verifying the tag fires
- In GTM, click Preview. This loads Tag Assistant in a new browser tab with your site.
- Navigate to any page on your site.
- In the Tag Assistant panel, you should see Personyze Tracking Code listed under “Tags Fired.”
- Open browser dev tools → Network tab → filter for
counter.personyze.com. You should see a request fire on every page load. - In Personyze admin, the visitor should appear in Visitors Activity in Real-Time within a few seconds.
Common issues
- Tag fires but no events in Personyze. Double-check the Site ID — most often a typo. Confirm via Settings → Domains and Tracking.
- Personalization doesn’t render. Tag may be firing too late. Check the trigger’s firing order — set Personyze to fire before any other tags that might interfere.
- SPA pages tracked twice or not tracked. See the SPA gotcha above — switch to a Page View trigger.