Signature
Import
About this widget
Theanalytics widget pushes the current state of the search to the analytics platform of your choice.
It requires the implementation of a function that pushes the data.
This widget doesn’t render a UI.
Examples
Google Analytics
JavaScript
Google Tag Manager
JavaScript
Segment.io
JavaScript
Kissmetrics
JavaScript
Options
function
required
A function that’s called every time the or refinements changes.
You need to add the logic to push the data to your analytics platform.The function takes three parameters:
formattedParameters. Contains the search parameters, serialized as a query string.state. Contains the whole search state.results. The last received results.
JavaScript
number
default:3000
The number of milliseconds between the last search keystroke and calling
pushFunction.JavaScript
boolean
Triggers
pushFunction after a page click or a redirect.
This is useful if you want the pushFunction to be called for the last actions before users leaves the current page,
even if the delay wasn’t reached.JavaScript
boolean
default:true
Triggers
pushFunction when InstantSearch is initialized.
This means the pushFunction might be called even though users didn’t perform any search-related action.JavaScript