To send events with InstantSearch.JS, you must first add the
search-insightslibrary 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 the
search-insightslibrary 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 the
ALGOLIA_INSIGHTS_SRCvariable 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 :