api-docs/docs/browser-tracker/markdown/browser-tracker.browsertracker.md
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@snowplow/browser-tracker](./browser-tracker.md) > [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) => void | Add a plugin into the plugin collection after Tracker has already been initialised |
| [clearUserData](./browser-tracker.browsertracker.clearuserdata.md) | (configuration?: ClearUserDataConfiguration) => 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) => boolean) => void | Enable querystring decoration for links passing a filter |
| [disableActivityTracking](./browser-tracker.browsertracker.disableactivitytracking.md) | () => void | Disables page activity tracking. |
| [disableActivityTrackingCallback](./browser-tracker.browsertracker.disableactivitytrackingcallback.md) | () => void | Disables page activity tracking callback. |
| [disableAnonymousTracking](./browser-tracker.browsertracker.disableanonymoustracking.md) | (configuration?: DisableAnonymousTrackingConfiguration) => 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) => void | Strip braces from URL |
| [discardHashTag](./browser-tracker.browsertracker.discardhashtag.md) | (enableFilter: boolean) => void | Strip hash tag (or anchor) from URL |
| [enableActivityTracking](./browser-tracker.browsertracker.enableactivitytracking.md) | (configuration: ActivityTrackingConfiguration) => void | Enables page activity tracking (sends page pings to the Collector regularly). |
| [enableActivityTrackingCallback](./browser-tracker.browsertracker.enableactivitytrackingcallback.md) | (configuration: ActivityTrackingConfiguration & ActivityTrackingConfigurationCallback) => void | Enables page activity tracking (replaces collector ping with callback). |
| [enableAnonymousTracking](./browser-tracker.browsertracker.enableanonymoustracking.md) | (configuration?: EnableAnonymousTrackingConfiguration) => void | Enables anonymous tracking (ie. tracker initialized without <code>anonymousTracking</code>) |
| [flushBuffer](./browser-tracker.browsertracker.flushbuffer.md) | (configuration?: FlushBufferConfiguration) => 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) => string | Get the cookie name as cookieNamePrefix + basename + . + domain. |
| [getDomainSessionIndex](./browser-tracker.browsertracker.getdomainsessionindex.md) | () => number | Get the domain session index also known as current memorized visit count. |
| [getDomainUserId](./browser-tracker.browsertracker.getdomainuserid.md) | () => string | Get visitor ID (from first party cookie) |
| [getDomainUserInfo](./browser-tracker.browsertracker.getdomainuserinfo.md) | () => ParsedIdCookie | Get the visitor information (from first party cookie) |
| [getPageViewId](./browser-tracker.browsertracker.getpageviewid.md) | () => string | Get the current page view ID |
| [getTabId](./browser-tracker.browsertracker.gettabid.md) | () => string \| null | Get the current browser tab ID |
| [getUserId](./browser-tracker.browsertracker.getuserid.md) | () => 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) | () => void | Expires current session and starts a new session. |
| [preservePageViewId](./browser-tracker.browsertracker.preservepageviewid.md) | () => void | Stop regenerating <code>pageViewId</code> (available from <code>web_page</code> context) |
| [setBufferSize](./browser-tracker.browsertracker.setbuffersize.md) | (newBufferSize: number) => 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) => 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) => void | Set first-party cookie path |
| [setCustomUrl](./browser-tracker.browsertracker.setcustomurl.md) | (url: string) => void | Override url |
| [setDocumentTitle](./browser-tracker.browsertracker.setdocumenttitle.md) | (title: string) => void | Override document.title |
| [setOptOutCookie](./browser-tracker.browsertracker.setoptoutcookie.md) | (name?: string \| null) => void | Sets the opt out cookie. |
| [setReferrerUrl](./browser-tracker.browsertracker.setreferrerurl.md) | (url: string) => void | Override referrer |
| [setUserId](./browser-tracker.browsertracker.setuserid.md) | (userId?: string \| null) => void | Set the business-defined user ID for this user. |
| [setUserIdFromCookie](./browser-tracker.browsertracker.setuseridfromcookie.md) | (cookieName: string) => void | Set the business-defined user ID for this user to the value of a cookie. |
| [setUserIdFromLocation](./browser-tracker.browsertracker.setuseridfromlocation.md) | (querystringField: string) => void | Set the business-defined user ID for this user using the location querystring. |
| [setUserIdFromReferrer](./browser-tracker.browsertracker.setuseridfromreferrer.md) | (querystringField: string) => void | Set the business-defined user ID for this user using the referrer querystring. |
| [setVisitorCookieTimeout](./browser-tracker.browsertracker.setvisitorcookietimeout.md) | (timeout: number) => 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 & CommonEventProperties) => void | Log visit to this page |
| [updatePageActivity](./browser-tracker.browsertracker.updatepageactivity.md) | () => void | Triggers the activityHandler manually to allow external user defined activity. i.e. While watching a video |