Skip to main content

Pageview Tracking

StorePilot records each page visit and how long the visitor spent on that page.

What Is Tracked

Data PointDescription
URLFull page URL (path + query string, no hash)
ReferrerPrevious page URL or traffic source
Time on pageDuration from page load until navigation away
Visitor IDAnonymous identifier linking this pageview to a visitor profile
TimestampWhen the pageview occurred

IP addresses are not stored. Geolocation (country, city) is resolved at ingest time and the raw IP is discarded.


Time-on-Page Measurement

When a page loads, a start timestamp is recorded. The duration is sent in one of two ways:

  1. visibilitychange event — when the user switches tabs or minimises the browser
  2. pagehide / beforeunload event — when the user navigates away

The final duration value is sent to the Platform via a POST /ingest/pageviews request.

Because beforeunload is not reliable on mobile browsers, the time-on-page metric is a best-effort measurement.


Analytics

Pageview data is aggregated in the Dashboard analytics view:

  • Pageviews per day — a time-series chart for the selected date range
  • Top pages — most visited URLs
  • Traffic sources — grouped by referrer domain
  • Sessions count — unique visitor sessions in the period

Excluded Pages

The following are excluded from tracking automatically:

  • WordPress Admin pages (/wp-admin/)
  • Login page (/wp-login.php)
  • Requests from logged-in administrators (if configured)

Single-Page Application (SPA) Compatibility

For WordPress themes that use client-side routing (e.g. Headless WordPress + Next.js), the tracker listens for popstate and hashchange events to detect navigation without a full page reload. Each navigation fires a new pageview event.