Personyze Support Personyze Support docs
Open Personyze
Integrations

Google Tag Manager

Install the Personyze tracking tag through Google Tag Manager — the recommended approach for sites that already use GTM. Includes the critical SPA trigger configuration to avoid conflicts.

Updated 1 day ago 3 min read
A
by Admin

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_T number 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

  1. Add a new tag. In your GTM workspace, click Tags → New.
  2. Choose the Personyze template. Click the tag-config area, then select Personyze Tracking Code from the gallery.
  3. Enter your Site ID. Paste the S_T number from your Personyze account into the Site ID field.
  4. 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.
  5. 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.

SPA gotcha — don’t use History Change triggers.For single-page applications, GTM’s History Change trigger fires a page-view event on every 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

  1. In GTM, click Preview. This loads Tag Assistant in a new browser tab with your site.
  2. Navigate to any page on your site.
  3. In the Tag Assistant panel, you should see Personyze Tracking Code listed under “Tags Fired.”
  4. Open browser dev tools → Network tab → filter for counter.personyze.com. You should see a request fire on every page load.
  5. 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.