To send events with InstantSearch.JS, you must first add thesearch-insights
library to your application(https://www.algolia.com/doc/guides/building-search-ui/going-further/send-insights-events/js/#installing-the-search-insights-library).
You can load thesearch-insights
library with either the jsDelivr CDN or your static file server. (jsDelivr is a third-party CDN. Algolia can’t provide support for such third-party services.) If you choose the latter, you must update theALGOLIA_INSIGHTS_SRC
variable to point to the file URL on your file server.
If instantsearch.middlewares is undefined, since jspm does not include middlewares, you would need to manually add an entry to grab middlewares from jsdelivr :