Personyze Wiki Personyze Wiki docs
Open Personyze
Data & Tracking

One-Page Applications

Enable Personyze tracking and personalization on single-page applications (SPAs) where URL changes don't trigger full page reloads. Plus how SPA mode interacts with cross-domain tracking.

Updated 9 hours ago 2 min read
A
by Admin

If your site is a single-page application — React, Vue, Angular, or any other framework where navigation happens client-side without full page reloads — Personyze needs explicit configuration to track those route changes. Otherwise, the entire SPA looks like one page view to Personyze, and personalization that depends on URL/route won’t fire on subsequent navigations.

Enabling SPA mode

Go to Account Settings → General Settings → Tracker Settings and switch the Single Page Application toggle to On.

Once enabled, every URL change in your SPA does the following:

  • Adds a new entry to the visitor’s page-view history
  • Re-evaluates audience matches for the new URL/route
  • Replaces any prior page-view-scoped placeholder content with content for the new route
  • Fires goal tracking and other URL-conditional rules

How detection works

Personyze listens for the standard SPA navigation signals — history.pushState, history.replaceState, and popstate events. Most modern frameworks (React Router, Vue Router, Next.js client-side nav) emit these correctly. If your framework uses hash-based routing (#/route URLs), Personyze also tracks those.

Conflict with Google Tag Manager.If you load Personyze through GTM, use the Page View trigger type — not History Change. GTM’s history-change trigger fires its own page-view event that conflicts with Personyze’s SPA detection. See the GTM guide for the correct trigger setup.

Verifying SPA tracking is working

  1. Open dev tools, network tab, filter by counter.personyze.com.
  2. Navigate within your SPA without a full reload (click an internal link).
  3. You should see a new request fire to counter.personyze.com with the new URL.
  4. In Personyze admin, go to Visitors Activity in Real-Time and confirm both URLs appear in your test session’s history.

Cross-domain tracking

SPA mode is independent from cross-domain tracking, but they often pair together. If your visitors move between multiple domains in your account (e.g., from marketing.brand.com to app.brand.com), enable both — see the Cross-Domain Tracking guide for that setup. Together, SPA mode and cross-domain tracking ensure a single visitor maps to a single Personyze profile across every route on every domain.

Troubleshooting

  • Personalization doesn’t update on route change. Confirm SPA mode is on, then check that your campaign’s targeting includes the new URL pattern (not just the initial landing URL).
  • Inflated page-view counts. Some SPAs fire pushState for non-navigation purposes (modal opens, tab switches). If you see suspiciously high page views, audit your routing code or contact support — we can configure URL filters to ignore specific patterns.
  • Goals not firing. Goals defined as “URL contains X” will now fire on every SPA route that matches. If that’s too liberal, add a more specific URL condition.