api-docs/docs/browser-tracker/markdown/browser-tracker.md
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@snowplow/browser-tracker](./browser-tracker.md)
## browser-tracker package
## Functions
| Function | Description |
| --- | --- |
| [addGlobalContexts(contexts, trackers)](./browser-tracker.addglobalcontexts.md) | All provided contexts will be sent with every event |
| [addPlugin(configuration, trackers)](./browser-tracker.addplugin.md) | Add a plugin into the plugin collection after trackers have already been initialised |
| [clearGlobalContexts(trackers)](./browser-tracker.clearglobalcontexts.md) | Clear all global contexts that are sent with events |
| [clearUserData(configuration, trackers)](./browser-tracker.clearuserdata.md) | Clears all cookies and local storage containing user and session identifiers |
| [crossDomainLinker(crossDomainLinkerCriterion, trackers)](./browser-tracker.crossdomainlinker.md) | Enable querystring decoration for links passing a filter |
| [disableActivityTracking(trackers)](./browser-tracker.disableactivitytracking.md) | Disables page activity tracking. |
| [disableActivityTrackingCallback(trackers)](./browser-tracker.disableactivitytrackingcallback.md) | Disables page activity tracking callback. |
| [disableAnonymousTracking(configuration, trackers)](./browser-tracker.disableanonymoustracking.md) | 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(enable, trackers)](./browser-tracker.discardbrace.md) | Strip braces from URL |
| [discardHashTag(enable, trackers)](./browser-tracker.discardhashtag.md) | Strip hash tag (or anchor) from URL |
| [enableActivityTracking(configuration, trackers)](./browser-tracker.enableactivitytracking.md) | Enables page activity tracking (sends page pings to the Collector regularly). |
| [enableActivityTrackingCallback(configuration, trackers)](./browser-tracker.enableactivitytrackingcallback.md) | Enables page activity tracking (replaces collector ping with callback). |
| [enableAnonymousTracking(configuration, trackers)](./browser-tracker.enableanonymoustracking.md) | Enables anonymous tracking (ie. tracker initialized without <code>anonymousTracking</code>) |
| [flushBuffer(configuration, trackers)](./browser-tracker.flushbuffer.md) | Send all events in the outQueue Only need to use this when sending events with a bufferSize of at least 2 |
| [newSession(trackers)](./browser-tracker.newsession.md) | Expires current session and starts a new session. |
| [newTracker(trackerId, endpoint)](./browser-tracker.newtracker.md) | Initialise a new tracker |
| [newTracker(trackerId, endpoint, configuration)](./browser-tracker.newtracker_1.md) | Initialise a new tracker |
| [preservePageViewId(trackers)](./browser-tracker.preservepageviewid.md) | Stop regenerating <code>pageViewId</code> (available from <code>web_page</code> context) |
| [removeGlobalContexts(contexts, trackers)](./browser-tracker.removeglobalcontexts.md) | All provided contexts will no longer be sent with every event |
| [setBufferSize(newBufferSize, trackers)](./browser-tracker.setbuffersize.md) | Set the buffer size Can be useful if you want to stop batching requests to ensure events start sending closer to event creation |
| [setCollectorUrl(collectorUrl, trackers)](./browser-tracker.setcollectorurl.md) | Specify the Snowplow collector URL. Specific http or https to force it or leave it off to match the website protocol. |
| [setCookiePath(path, trackers)](./browser-tracker.setcookiepath.md) | Set first-party cookie path |
| [setCustomUrl(url, trackers)](./browser-tracker.setcustomurl.md) | Override url |
| [setDocumentTitle(title, trackers)](./browser-tracker.setdocumenttitle.md) | Override document.title |
| [setOptOutCookie(name, trackers)](./browser-tracker.setoptoutcookie.md) | Sets the opt out cookie. |
| [setReferrerUrl(url, trackers)](./browser-tracker.setreferrerurl.md) | Override referrer |
| [setUserId(userId, trackers)](./browser-tracker.setuserid.md) | Set the business-defined user ID for this user. |
| [setUserIdFromCookie(cookieName, trackers)](./browser-tracker.setuseridfromcookie.md) | Set the business-defined user ID for this user to the value of a cookie. |
| [setUserIdFromLocation(querystringField, trackers)](./browser-tracker.setuseridfromlocation.md) | Set the business-defined user ID for this user using the location querystring. |
| [setUserIdFromReferrer(querystringField, trackers)](./browser-tracker.setuseridfromreferrer.md) | Set the business-defined user ID for this user using the referrer querystring. |
| [setVisitorCookieTimeout(timeout, trackers)](./browser-tracker.setvisitorcookietimeout.md) | Set visitor cookie timeout (in seconds) |
| [trackPageView(event, trackers)](./browser-tracker.trackpageview.md) | Track a visit to a web page |
| [trackSelfDescribingEvent(event, trackers)](./browser-tracker.trackselfdescribingevent.md) | Track a self-describing event happening on this page. A custom event type, allowing for an event to be tracked using your own custom schema and a data object which conforms to the supplied schema |
| [trackStructEvent(event, trackers)](./browser-tracker.trackstructevent.md) | Track a structured event A classic style of event tracking, allows for easier movement between analytics systems. A loosely typed event, creating a Self Describing event is preferred, but useful for interoperability. |
| [updatePageActivity(trackers)](./browser-tracker.updatepageactivity.md) | Triggers the activityHandler manually to allow external user defined activity. i.e. While watching a video |
## Interfaces
| Interface | Description |
| --- | --- |
| [ActivityTrackingConfiguration](./browser-tracker.activitytrackingconfiguration.md) | The base configuration for activity tracking |
| [ActivityTrackingConfigurationCallback](./browser-tracker.activitytrackingconfigurationcallback.md) | The callback for enableActivityTrackingCallback |
| [BrowserPlugin](./browser-tracker.browserplugin.md) | Interface which defines Core Plugins |
| [BrowserPluginConfiguration](./browser-tracker.browserpluginconfiguration.md) | The configuration of the plugin to add |
| [BrowserTracker](./browser-tracker.browsertracker.md) | The Browser Tracker |
| [ClearUserDataConfiguration](./browser-tracker.clearuserdataconfiguration.md) | The configuration that can be changed when enabling anonymous tracking |
| [ClientSession](./browser-tracker.clientsession.md) | Schema for client client session context entity |
| [CommonEventProperties](./browser-tracker.commoneventproperties.md) | Additional data points to set when tracking an event |
| [ContextEvent](./browser-tracker.contextevent.md) | Argument for [ContextGenerator](./browser-tracker.contextgenerator.md) and [ContextFilter](./browser-tracker.contextfilter.md) callback |
| [DisableAnonymousTrackingConfiguration](./browser-tracker.disableanonymoustrackingconfiguration.md) | The configuration that can be changed when disabling anonymous tracking |
| [EnableAnonymousTrackingConfiguration](./browser-tracker.enableanonymoustrackingconfiguration.md) | The configuration that can be changed when enabling anonymous tracking |
| [FlushBufferConfiguration](./browser-tracker.flushbufferconfiguration.md) | The configuration that can be changed when flushing the buffer |
| [PageViewEvent](./browser-tracker.pageviewevent.md) | A Page View event Used for tracking a page view |
| [RuleSet](./browser-tracker.ruleset.md) | A ruleset has accept or reject properties that contain rules for matching Iglu schema URIs |
| [SelfDescribingEvent](./browser-tracker.selfdescribingevent.md) | A Self Describing Event A custom event type, allowing for an event to be tracked using your own custom schema and a data object which conforms to the supplied schema |
| [StructuredEvent](./browser-tracker.structuredevent.md) | A Structured Event A classic style of event tracking, allows for easier movement between analytics systems. A loosely typed event, creating a Self Describing event is preferred, but useful for interoperability. |
## Variables
| Variable | Description |
| --- | --- |
| [version](./browser-tracker.version.md) | |
## Type Aliases
| Type Alias | Description |
| --- | --- |
| [ActivityCallback](./browser-tracker.activitycallback.md) | The callback for enableActivityTrackingCallback |
| [ActivityCallbackData](./browser-tracker.activitycallbackdata.md) | The data which is passed to the Activity Tracking callback |
| [AnonymousTrackingOptions](./browser-tracker.anonymoustrackingoptions.md) | |
| [BuiltInContexts](./browser-tracker.builtincontexts.md) | |
| [ConditionalContextProvider](./browser-tracker.conditionalcontextprovider.md) | Conditional context providers are two element arrays used to decide when to attach contexts, where: - the first element is some conditional criterion - the second element is any number of context primitives |
| [ContextFilter](./browser-tracker.contextfilter.md) | A context filter is a user-supplied callback that is evaluated for each event to determine if the context associated with the filter should be attached to the event |
| [ContextGenerator](./browser-tracker.contextgenerator.md) | A context generator is a user-supplied callback that is evaluated for each event to allow an additional context to be dynamically attached to the event |
| [ContextPrimitive](./browser-tracker.contextprimitive.md) | A context primitive is either a self-describing JSON or a context generator |
| [CookieSameSite](./browser-tracker.cookiesamesite.md) | |
| [EventBatch](./browser-tracker.eventbatch.md) | A collection of events which are sent to the collector. This can either be a collection of query strings or JSON objects. |
| [EventMethod](./browser-tracker.eventmethod.md) | |
| [ExtendedCrossDomainLinkerAttributes](./browser-tracker.extendedcrossdomainlinkerattributes.md) | |
| [ExtendedCrossDomainLinkerOptions](./browser-tracker.extendedcrossdomainlinkeroptions.md) | |
| [FilterProvider](./browser-tracker.filterprovider.md) | A filter provider is a tuple that has two parts: a context filter and the context primitive(s) If the context filter evaluates to true, the tracker will attach the context primitive(s) |
| [GetBatch](./browser-tracker.getbatch.md) | A collection of GET events which are sent to the collector. This will be a collection of query strings. |
| [ParsedIdCookie](./browser-tracker.parsedidcookie.md) | The format of state elements stored in the <code>id</code> cookie. |
| [Platform](./browser-tracker.platform.md) | |
| [PostBatch](./browser-tracker.postbatch.md) | A collection of POST events which are sent to the collector. This will be a collection of JSON objects. |
| [RequestFailure](./browser-tracker.requestfailure.md) | The data that will be available to the <code>onRequestFailure</code> callback |
| [RuleSetProvider](./browser-tracker.rulesetprovider.md) | A ruleset provider is aa tuple that has two parts: a ruleset and the context primitive(s) If the ruleset allows the current event schema URI, the tracker will attach the context primitive(s) |
| [SelfDescribingJson](./browser-tracker.selfdescribingjson.md) | Export interface for any Self-Describing JSON such as context or Self Describing events |
| [StateStorageStrategy](./browser-tracker.statestoragestrategy.md) | |
| [TrackerConfiguration](./browser-tracker.trackerconfiguration.md) | The configuration object for initialising the tracker |