Autocomplete, InstantSearch, and Recommend in the Algolia app blocks now support version 5 of the Algolia API client.
Most stores only need to switch the search client version setting to Version 5.
If you use custom storefront JavaScript, follow the version 5 upgrade guide.
Support for version 4 ends on August 14, 2026.
Insights hooks
The following hooks change aspects of the Insights integration for sending click and conversion events.beforeAlgoliaAnalyticsOptions
Changes options for the Insights library.
Parameters
Insights options.
Returns
Examples
Opt out of Insights events
Opt out of Insights events
Set
userHasOptedOut to true to prevent the integration from sending Insights events.JavaScript
beforeAddToCartSelector
Changes the CSS selector for the add-to-cart button.
Parameters
Returns
Examples
Use a custom add-to-cart selector
Use a custom add-to-cart selector
Return a custom selector if your theme uses a different add-to-cart button.
JavaScript
Recommend hook
This hook changes the behavior of recommendations from Algolia Recommend.beforeRecommendHitTemplate
Customize the HTML template that renders the recommendations panel.
Parameters
Returns
Examples
Customize the recommendation item template
Customize the recommendation item template
Return a custom HTML template to match your theme’s recommendation card layout.
JavaScript
beforeAddToCartSelectorString (deprecated)
This hook is deprecated.
Use
beforeAddToCartSelector instead.