Skip to content

Track hash routes

Record pageviews when a single-page application changes the URL fragment.

Enable hash routing when routes such as /#/account represent separate pages.

  1. Open Settings → Tracking.

  2. Turn on Track hash routes, then select Save tracking settings.

  3. Navigate between two hash routes in your application.

    https://example.com/#/home
    https://example.com/#/account

The tracker already watches history.pushState() and back/forward navigation. This setting additionally sends a pageview when the fragment changes.

What you should see: the pageview count increases as you navigate between hash routes.