<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/browser-tracker](./browser-tracker.md) &gt; [BrowserTracker](./browser-tracker.browsertracker.md) &gt; [preservePageViewIdForUrl](./browser-tracker.browsertracker.preservepageviewidforurl.md)

## 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`<!-- -->.

<b>Signature:</b>

```typescript
preservePageViewIdForUrl: (preserve: PreservePageViewIdForUrl) => void;
```
