To automatically send events with Autocomplete, turn the
insights option to
true in your Autocomplete instance. Autocomplete loads the
search-insights library automatically from jsDelivr. You don’t need to install it or set it up yourself.
Below is a Code Sandbox using CDNs to import Autocomplete, the Query Suggestions plugin, and the Autocomplete classic theme
In addition to setting the
insights option to true,
clickAnalytics has also been set to true in both the Query Suggestions plugin and the
getAlgoliaResults function. This Code Sandbox follows the best practices outlined in our Autocomplete Sending Algolia Insights Events guide, where you can learn more about this topic.