<!-- 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)

## BrowserTracker interface

The Browser Tracker

<b>Signature:</b>

```typescript
interface BrowserTracker 
```

## Properties

|  Property | Type | Description |
|  --- | --- | --- |
|  [addPlugin](./browser-tracker.browsertracker.addplugin.md) | (configuration: BrowserPluginConfiguration) =&gt; void | Add a plugin into the plugin collection after Tracker has already been initialised |
|  [clearUserData](./browser-tracker.browsertracker.clearuserdata.md) | (configuration?: ClearUserDataConfiguration) =&gt; void | Clears all cookies and local storage containing user and session identifiers |
|  [core](./browser-tracker.browsertracker.core.md) | TrackerCore | The instance of the core library which this tracker has initialised |
|  [crossDomainLinker](./browser-tracker.browsertracker.crossdomainlinker.md) | (crossDomainLinkerCriterion: (elt: HTMLAnchorElement \| HTMLAreaElement) =&gt; boolean) =&gt; void | Enable querystring decoration for links passing a filter |
|  [disableActivityTracking](./browser-tracker.browsertracker.disableactivitytracking.md) | () =&gt; void | Disables page activity tracking. |
|  [disableActivityTrackingCallback](./browser-tracker.browsertracker.disableactivitytrackingcallback.md) | () =&gt; void | Disables page activity tracking callback. |
|  [disableAnonymousTracking](./browser-tracker.browsertracker.disableanonymoustracking.md) | (configuration?: DisableAnonymousTrackingConfiguration) =&gt; void | Disables anonymous tracking if active (ie. tracker initialized with <code>anonymousTracking</code>) For stateStorageStrategy override, uses supplied value first, falls back to one defined in initial config, otherwise uses cookieAndLocalStorage. |
|  [discardBrace](./browser-tracker.browsertracker.discardbrace.md) | (enableFilter: boolean) =&gt; void | Strip braces from URL |
|  [discardHashTag](./browser-tracker.browsertracker.discardhashtag.md) | (enableFilter: boolean) =&gt; void | Strip hash tag (or anchor) from URL |
|  [enableActivityTracking](./browser-tracker.browsertracker.enableactivitytracking.md) | (configuration: ActivityTrackingConfiguration) =&gt; void | Enables page activity tracking (sends page pings to the Collector regularly). |
|  [enableActivityTrackingCallback](./browser-tracker.browsertracker.enableactivitytrackingcallback.md) | (configuration: ActivityTrackingConfiguration &amp; ActivityTrackingConfigurationCallback) =&gt; void | Enables page activity tracking (replaces collector ping with callback). |
|  [enableAnonymousTracking](./browser-tracker.browsertracker.enableanonymoustracking.md) | (configuration?: EnableAnonymousTrackingConfiguration) =&gt; void | Enables anonymous tracking (ie. tracker initialized without <code>anonymousTracking</code>) |
|  [flushBuffer](./browser-tracker.browsertracker.flushbuffer.md) | (configuration?: FlushBufferConfiguration) =&gt; void | Send all events in the outQueue Only need to use this when sending events with a bufferSize of at least 2 |
|  [getCookieName](./browser-tracker.browsertracker.getcookiename.md) | (basename: string) =&gt; string | Get the cookie name as cookieNamePrefix + basename + . + domain. |
|  [getDomainSessionIndex](./browser-tracker.browsertracker.getdomainsessionindex.md) | () =&gt; number | Get the domain session index also known as current memorized visit count. |
|  [getDomainUserId](./browser-tracker.browsertracker.getdomainuserid.md) | () =&gt; string | Get visitor ID (from first party cookie) |
|  [getDomainUserInfo](./browser-tracker.browsertracker.getdomainuserinfo.md) | () =&gt; ParsedIdCookie | Get the visitor information (from first party cookie) |
|  [getPageViewId](./browser-tracker.browsertracker.getpageviewid.md) | () =&gt; string | Get the current page view ID |
|  [getTabId](./browser-tracker.browsertracker.gettabid.md) | () =&gt; string \| null | Get the current browser tab ID |
|  [getUserId](./browser-tracker.browsertracker.getuserid.md) | () =&gt; string \| null \| undefined | Get the current user ID (as set previously with setUserId()). |
|  [id](./browser-tracker.browsertracker.id.md) | string | The unique identifier of this tracker |
|  [namespace](./browser-tracker.browsertracker.namespace.md) | string | The tracker namespace |
|  [newSession](./browser-tracker.browsertracker.newsession.md) | () =&gt; void | Expires current session and starts a new session. |
|  [preservePageViewId](./browser-tracker.browsertracker.preservepageviewid.md) | () =&gt; void | Stop regenerating <code>pageViewId</code> (available from <code>web_page</code> context) |
|  [preservePageViewIdForUrl](./browser-tracker.browsertracker.preservepageviewidforurl.md) | (preserve: PreservePageViewIdForUrl) =&gt; void | Decide how the <code>pageViewId</code> should be preserved based on the URL. If set to <code>false</code>, the <code>pageViewId</code> 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 <code>true</code> or <code>'full'</code>, the <code>pageViewId</code> 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 <code>'pathname'</code>, the <code>pageViewId</code> will be kept the same for all page views with the same pathname (search params or fragment may change). If set to <code>'pathnameAndSearch'</code>, the <code>pageViewId</code> will be kept the same for all page views with the same pathname and search params (fragment may change). If <code>preservePageViewId</code> is enabled, the <code>preservePageViewIdForUrl</code> setting is ignored. Defaults to <code>false</code>. |
|  [setBufferSize](./browser-tracker.browsertracker.setbuffersize.md) | (newBufferSize: number) =&gt; void | Alter buffer size Can be useful if you want to stop batching requests to ensure events start sending closer to event creation |
|  [setCollectorUrl](./browser-tracker.browsertracker.setcollectorurl.md) | (collectorUrl: string) =&gt; void | Specify the Snowplow collector URL. Specific http or https to force it or leave it off to match the website protocol. |
|  [setCookiePath](./browser-tracker.browsertracker.setcookiepath.md) | (path: string) =&gt; void | Set first-party cookie path |
|  [setCustomUrl](./browser-tracker.browsertracker.setcustomurl.md) | (url: string) =&gt; void | Override url |
|  [setDocumentTitle](./browser-tracker.browsertracker.setdocumenttitle.md) | (title: string) =&gt; void | Override document.title |
|  [setOptOutCookie](./browser-tracker.browsertracker.setoptoutcookie.md) | (name?: string \| null) =&gt; void | Sets the opt out cookie. |
|  [setReferrerUrl](./browser-tracker.browsertracker.setreferrerurl.md) | (url: string) =&gt; void | Override referrer |
|  [setUserId](./browser-tracker.browsertracker.setuserid.md) | (userId?: string \| null) =&gt; void | Set the business-defined user ID for this user. |
|  [setUserIdFromCookie](./browser-tracker.browsertracker.setuseridfromcookie.md) | (cookieName: string) =&gt; void | Set the business-defined user ID for this user to the value of a cookie. |
|  [setUserIdFromLocation](./browser-tracker.browsertracker.setuseridfromlocation.md) | (querystringField: string) =&gt; void | Set the business-defined user ID for this user using the location querystring. |
|  [setUserIdFromReferrer](./browser-tracker.browsertracker.setuseridfromreferrer.md) | (querystringField: string) =&gt; void | Set the business-defined user ID for this user using the referrer querystring. |
|  [setVisitorCookieTimeout](./browser-tracker.browsertracker.setvisitorcookietimeout.md) | (timeout: number) =&gt; void | Set visitor cookie timeout (in seconds) |
|  [sharedState](./browser-tracker.browsertracker.sharedstate.md) | SharedState | The instance of shared state this tracker is using |
|  [trackPageView](./browser-tracker.browsertracker.trackpageview.md) | (event?: PageViewEvent &amp; CommonEventProperties) =&gt; void | Log visit to this page |
|  [updatePageActivity](./browser-tracker.browsertracker.updatepageactivity.md) | () =&gt; void | Triggers the activityHandler manually to allow external user defined activity. i.e. While watching a video |

