Skip to main content

browser-tracker.browsertracker.preservepageviewidforurl

Home > @snowplow/browser-tracker > BrowserTracker > preservePageViewIdForUrl

BrowserTracker.preservePageViewIdForUrl property

Decide how the pageViewId should be preserved based on the URL. If set to false, the pageViewId will be regenerated on the second and each following page view event (first page view doesn't change the page view ID since tracker initialization). If set to true or 'full', the pageViewId will be kept the same for all page views with that exact URL (even for events tracked before the page view event). If set to 'pathname', the pageViewId will be kept the same for all page views with the same pathname (search params or fragment may change). If set to 'pathnameAndSearch', the pageViewId will be kept the same for all page views with the same pathname and search params (fragment may change). If preservePageViewId is enabled, the preservePageViewIdForUrl setting is ignored. Defaults to false.

Signature:
preservePageViewIdForUrl: (preserve: PreservePageViewIdForUrl) => void;