How to Track Every Screen in a Single-Page App

November 15, 2026 3 min read News

Single-page apps change the address bar without reloading the page. A chat-style app, a dashboard-like tool or a modern storefront built as a single-page app all do this: the visitor moves from screen to screen while the page stays loaded. For a normal web analytics tracker that looks like one long page view. Since November 13 this year, Hitsteps can do better: add spa=1 to your tracking code and every route change counts as its own page view. Chat-style and single-page apps then measure just like normal sites.

Here is how to turn that on.

Find your tracking code

Sign in to the Hitsteps dashboard, open your site and go to Settings, then Tracking Code. Copy the full tracking code block, script tag and noscript together, not just the API code; keep the two parts side by side. For a plain HTML site, paste the block before the closing body tag on every page, or into the shared footer or template if your site has one. If you install through WordPress, Google Tag Manager or another platform, you still start from this same tracking code.

Add spa=1 to the code URL

Inside the block you copied, the loader URL carries your code and ends like this:

https://edgecdnplus.com/code?code=YOUR-CODE

Here YOUR-CODE stands for the code in your own block. Add spa=1 as a parameter at the end of that URL, and nowhere else:

https://edgecdnplus.com/code?code=YOUR-CODE&spa=1

The only edit is that one parameter. Leave the script tag, its attributes and the noscript part exactly as Settings shows them. Only one installation method per page: remove any duplicate snippet or an old plugin-plus-manual combination, because installing the code twice inflates your activity.

What changes after you save

From the moment the updated code loads, every route change in your single-page app is reported as a page view. The changes that count are path or query changes: opening another screen, changing a filter, or stepping through a checkout that lives inside the page. Each one shows up in your pages report like a separate page on a normal site. Hash-only changes keep the tracker’s existing behavior, and the same URL is not sent twice. Your real-time visitor tracking and your page-level reports reflect the actual path visitors take instead of one undifferentiated visit.

The change is opt-in, so your existing tracking keeps behaving exactly as before until you add the parameter.

Check that it works

After you save and publish the updated template, open your site in another tab and move through a few screens. Clear any page, CMS, server or CDN cache that could still serve the old HTML, then check the dashboard: today’s visits should show the routes you opened as separate page views. Your own test visit will appear in the reports. To keep your testing out of your audience numbers, open Visitors in the site dashboard, then Exclude IP, or use the cookie method when your address changes.

What to measure next

Once route changes count correctly, you have something more useful than a visitor total: you know which screens in your app people actually reach, and where they stop. Pair that with our guide on getting started and installation if this is your first tracker, and with the real-time visitor tracking report to watch the routes appear live.

If your site is a single-page app and you have not tried Hitsteps yet, create a free account, add your site and paste your tracking code in a few minutes. Create your free account

Leave a Reply

Your email address will not be published. Required fields are marked *