Tag: Single page app
All blog posts with this tag.

- 19 Oct, 2026
Single-page app analytics: a pre-launch QA checklist
An engineer adds a tracking script to a web application. The homepage appears in the dashboard and the installation check passes, so the task is marked complete. Yet internal routes barely appear in reporting. On other screens, each transition is recorded twice. Single-page applications can display many routes without reloading the original HTML document. A tool watching only initial page loads may miss those changes. A tool configured with both automatic history tracking and manual events may count the same view more than once. The acceptance question is therefore not "did the script load?" It is "does each meaningful screen change create the expected event, once, with the right context?" Why SPA navigation changes the measurement problem Traditional navigation usually loads a new document. A SPA router often changes visible content and sometimes the URL while keeping the same document alive. The History API supports adding and replacing history entries without a full reload. MDN documents an easy-to-miss detail: invoking "pushState" or "replaceState" does not itself fire "popstate". Back and forward navigation can fire that event, but using only "popstate" may miss internal route transitions initiated by application code. Overlapping listeners cause the opposite problem. A router hook, tag manager and automatic measurement can all consider the same transition a new page. Google's official SPA guidance recommends verifying page-view events and referrer values as users navigate. It also warns that combining methods can cause double counting. Define a meaningful page view first Not every state transition is a new page for reporting purposes. Opening a menu, changing a filter or viewing a modal may alter the interface without creating a new content screen. Write a definition that matches a decision. For a marketing website, a route displaying a distinct piece of content may count as a page view. For an authenticated product, an internal step may be better represented by a specific action event. What matters is a documented policy. A working definition might be: "Record one page view after successfully displaying a new content screen identified by its canonical path, if that change is a unit we need to report on." This is a deliberate local contract, not a universal standard. Also document intentional exclusions: UI filters, loading placeholders and private routes that should not be measured. Choose a small but representative route matrix Testing every path is rarely necessary to uncover the main classes of errors. Test distinct navigation behaviours, including an initial visit, an internal link, back, forward, redirects and query-parameter changes.Scenario Expected observationInitial direct visit One page view when collection is enabledInternal link to new content One new view for the displayed screenBrowser back Consistent return to the previous pathBrowser forward Path and previous-page context follow the definitionAutomatic redirect Final screen counted without unintended duplicatesFilter change on a list No new page view unless it constitutes a new screenModal open and close Separate event only if usefulFailed or interrupted loading Explicit policy for countingFictional sensitive query parameter Restricted value not transmittedRecord the previous path, next path, navigation method, outgoing request and reported event for each test. Six frequent failure patterns Only the initial page appears When measurement observes document load only, internal SPA routes can disappear from reporting. A multi-screen application looks like a one-page site, and engagement metrics become hard to interpret. Confirm whether the instrumented tracker is aware of the router and version actually deployed. Do not assume universal behaviour across frameworks. Every internal route is counted twice An automatic event and a manual event can describe the same screen. Inspect the network immediately after one navigation. Two outgoing requests require investigation, although they do not automatically prove two final rows without checking the full processing path. Google's pageview documentation shows how to disable automatic pageview measurement when manual tracking is used. A useful general rule is to nominate one authority for generating a page view. Referrer context is inconsistent The count may be right while the previous-page context is wrong. A documentation journey can then look as though it came from an older route or acquisition source. Inspect how the vendor defines "referrer." An HTTP Referer header and a virtual previous page reconstructed by the analytics product are not always interchangeable. URLs contain unexpected information Routes and queries may carry account IDs, search terms, email addresses or tokens. Sending the entire URL to analytics can expose information unnecessary for audience reporting. Use canonical route rules and parameter filtering, including on authenticated surfaces. Our URL filtering guide discusses practical examples. Use fictional distinctive values to verify that forbidden fields never leave the browser. Events belong to the wrong screen A conversion fired during navigation may be attached to the preceding route, a temporary URL or a reloaded confirmation. Check the order of view transitions, backend responses, outgoing events and report updates. A submit click alone does not establish a completed lead. Separate intent events from successful operations. Component lifecycle causes duplicate events Some development environments deliberately mount or replay component effects to expose lifecycle defects. A tracking effect that is not idempotent may send duplicate events. Compare a production build with development behaviour before labelling the issue a live incident. Even development-only duplicates indicate brittle instrumentation worth fixing. A practical four-stage QA method Use test accounts and synthetic input Keep the test isolated. Open browser network tools and, if the vendor offers one, a debug mode. Avoid adding invasive tracking of actual users simply to make testing easier. Execute the same journey twice Run a stable sequence, including direct entry, internal navigation, back and forward. Repeat in another browser when practical. The aim is to cover different navigation mechanics rather than accumulate arbitrary clicks. Compare three evidence layers Contrast the human action log, actual outgoing requests and final report. Differences may reflect delayed processing, filters, consent decisions or an instrumentation error. Check the documented data pipeline before declaring a missing result. Make the result actionable Log each defect with route, trigger, observed request, reporting impact and intended fix. Require a reproducible test before switching from automatic to manual route tracking. Repeat the essential cases whenever the router, form handling or analytics configuration changes. Protect data while testing SPAs can have complicated journeys without needing exhaustive collection. A compact set of page views and selected actions often answers a marketing or documentation team's questions. Do not send application account IDs or debug tokens to analytics simply because they are handy for troubleshooting. Distinguish technical logs, incident diagnostics and audience measurement. Consent and transparency obligations do not disappear because the application is a SPA. The CNIL's conditions for narrowly scoped audience measurement remain specific to purpose and implementation. How to evaluate a vendor's SPA support Ask which navigation mechanisms are detected, how duplicates are prevented, whether paths are normalised and which QA procedures are recommended. An analytics provider may require manual configuration for some routers. That is not necessarily a defect, provided it is documented and verifiable. For Pomelo as for competitors, compatibility should be tested on the actual application, deployed script version and configuration. A universal compatibility claim is not evidence that event collection works correctly in your application. Turn the QA matrix into a release safeguard A one-time manual test is useful, but its long-term value increases when it becomes part of ordinary releases. Record four journeys that matter most: direct entry to an internal route, client-side transitions, browser back and forward, and a confirmed form action. Where infrastructure allows, add browser automation that records outgoing analytics requests using synthetic accounts. Not every commit needs to verify the full live reporting pipeline. It can instead assert that a route change emits exactly one intended event with a canonical path and without a test secret in the payload. Reserve slower end-to-end checks for a controlled environment and a known release candidate. Separate evidence layers: unit tests for tracking helpers, browser tests for navigation behaviour and sampled report verification for the actual destination. When a check fails, classify it instead of adding a retry. A missing event, duplicate request and unexpected URL field are different defects. They require different corrections and owners. The benefit is consistency: changing a framework version, tag-manager rule or consent configuration can no longer silently rewrite metric definitions while dashboards keep rendering as if nothing changed. Conclusion: a page view is a tested contract Successful installation does not end when a tag loads. The evidence is agreement between a screen displayed, an event sent and a metric reported. Choose representative routes, exercise transitions, inspect payloads and retain the results. That is more convincing than a green installation indicator with no route-level verification. FAQ Should every click in a SPA send a pageview? No. A pageview should represent a meaningful content-screen transition, not every interaction. Important clicks may use distinct action events. Does popstate observe all router transitions? No. MDN explains that pushState and replaceState do not directly fire popstate. Application-driven navigation needs appropriate handling. Why are my views duplicated? Automatic and manual tracking can overlap. Inspect the outgoing requests and vendor configuration to identify the actual cause. Should full URLs always be transmitted? Not without review. Paths and query parameters can carry personal or sensitive information. Canonicalisation and filtering reduce unnecessary exposure. SourcesGoogle for Developers, measure single-page applications Google for Developers, measure pageviews MDN, working with the History API MDN, popstate event CNIL, audience measurement tools
Just the right measure, for all your websites.
Pomelo is opening gradually. Join the first teams measuring right and help shape what comes next.
