@@ -1,5 +1,6 @@
|
||||
import { sendEvent } from './events'
|
||||
const instantsearch = require('instantsearch.js').default
|
||||
const { searchBox, hits, configure } = require('instantsearch.js/es/widgets')
|
||||
const { searchBox, hits, configure, analytics } = require('instantsearch.js/es/widgets')
|
||||
const algoliasearch = require('algoliasearch')
|
||||
const searchWithYourKeyboard = require('search-with-your-keyboard')
|
||||
const querystring = require('querystring')
|
||||
@@ -162,6 +163,15 @@ export default function () {
|
||||
autofocus: (hasStandaloneSearch()) && !window.location.hash.length,
|
||||
showReset: false,
|
||||
showSubmit: false
|
||||
}),
|
||||
analytics({
|
||||
pushFunction (params, state, results) {
|
||||
sendEvent({
|
||||
type: 'search',
|
||||
search_query: results.query
|
||||
// search_context
|
||||
})
|
||||
}
|
||||
})
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user