useTracking
useTracking
provides methods for enabling tracking features.
Usage
useTracking pulls the Search.io Pipeline, as provided by the closest SearchProvider, and forwards a set of utilities which are useful for various tracking use-cases. For more in-depth on how to use it, please refer to the Tracking section.
Anatomy
useTracking
returns an object containing the following properties:
Name | Type | Default | Description |
---|---|---|---|
handleResultClicked | (url: string) => void | The callback to attach on result when click, can be used in conjunction with GoogleAnalytics,... | |
consumeInteractionToken | (token: string, identifier: string, weight: number,data?: Record<string, string>) => Promise<void> | Method to consume pos/neg token when using PosNegTracking. | |
tracking | NoTracking | EventTracking | ClickTracking | PosNegTracking | instance of Tracking used in the current Pipeline. See Tracking for more details. | |
posNegLocalStorageManager | PosNegLocalStorageManager | instance of PosNegLocalStorageManager for localstorage based management of PosNeg tokens. See Advanced tracking for more details. |
Parameters
Name | Type | Default | Description |
---|