trackPageview
Sends a pageview. You rarely need it. The first page load and client-side navigations are tracked automatically.
Use it for "virtual" pages that don't change the URL, such as the steps of a modal wizard, or when you turned automatic pageviews off.
JavaScript
sublim.trackPageview({ url: 'https://example.com/signup/step-2' });
Signature
TypeScript
trackPageview(options?: {
url?: string;
referrer?: string;
title?: string;
props?: Record<string, string | number | boolean>;
}): void
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | location.href | Full URL of the page. |
referrer | string | document.referrer | Where the visitor came from. |
title | string | document.title | Page title, shown next to the path in reports. |
props | object | — | Properties attached to this pageview. |
Behaviour
- The same URL sent twice within one second is counted once, so a manual call doesn't double the automatic one.
- Each pageview closes the previous page's engagement measurement.
Sending every pageview yourself
To take full control, turn off both automatic options. With autocapture on, the initial pageview is sent even if trackPageview is false.
JavaScript
sublim.o = {
projectId: 'YOUR_PROJECT_ID',
autocapture: false,
trackPageview: false,
};