File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ import { sendEvent } from './events'
12const instantsearch = require ( 'instantsearch.js' ) . default
2- const { searchBox, hits, configure } = require ( 'instantsearch.js/es/widgets' )
3+ const { searchBox, hits, configure, analytics } = require ( 'instantsearch.js/es/widgets' )
34const algoliasearch = require ( 'algoliasearch' )
45const searchWithYourKeyboard = require ( 'search-with-your-keyboard' )
56const querystring = require ( 'querystring' )
@@ -162,6 +163,15 @@ export default function () {
162163 autofocus : ( hasStandaloneSearch ( ) ) && ! window . location . hash . length ,
163164 showReset : false ,
164165 showSubmit : false
166+ } ) ,
167+ analytics ( {
168+ pushFunction ( params , state , results ) {
169+ sendEvent ( {
170+ type : 'search' ,
171+ search_query : results . query
172+ // search_context
173+ } )
174+ }
165175 } )
166176 ]
167177 )
You can’t perform that action at this time.
0 commit comments