Records the current page view by collecting the normalized URL, referrer,
timezone, SDK version, and calculated page-count, then dispatching a tracking
pixel to the configured API endpoint.
When called without overrides the function:
Reads { actualUrl, recordUrl } from getURL() so canonical/meta overrides
are respected while still tracking refresh detection.
Reads { actualReferrer, recordReferrer } from getReferrer() so the
recorded referrer can differ from the in-session navigation path.
Computes the page count via getPCount() to understand the visit depth.
Skips recording if a refresh is detected and trackPageRefreshes is false.
Persists the new pcount and referrer values for the next navigation.
Parameters
Optionalurl: string
Optional override for the recorded URL path (defaults to recordUrl)
Optionalreferrer: string
Optional override for the recorded referrer path (defaults to recordReferrer)
Returns void
Example
// Record the current page view using canonical/meta data recordView();
// Record a virtual page view for in-app navigation recordView("/pricing", "/features");
Records the current page view by collecting the normalized URL, referrer, timezone, SDK version, and calculated page-count, then dispatching a tracking pixel to the configured API endpoint.
When called without overrides the function:
{ actualUrl, recordUrl }fromgetURL()so canonical/meta overrides are respected while still tracking refresh detection.{ actualReferrer, recordReferrer }fromgetReferrer()so the recorded referrer can differ from the in-session navigation path.getPCount()to understand the visit depth.trackPageRefreshesis false.pcountand referrer values for the next navigation.