Integrations
/
Shopify
Jan. 02, 2024
Shopify Algolia global events
From December 31, 2023, Algolia’s Search and Discovery application can’t modify the coding of Shopify themes. For more information, refer to Shopify’s Asset API documentation. As an alternative, Algolia offers Shopify’s App Embed and App Blocks features for Autocomplete and InstantSearch interfaces. For more information, refer to the Quick start and Shopify Algolia configuration documentation.
The InstantSearch and Autocomplete libraries emit global events. You can’t pass data to the global events but you can listen to them.
algolia.autocomplete.beforeInitis emitted before the Autocomplete library is initializedalgolia.autocomplete.afterInitis emitted after the Autocomplete library is initializedalgolia.autocomplete.hitClickActionis emitted when a user clicks on an Autocomplete resultalgolia.instantsearch.beforeInitis emitted before the InstantSearch library is initializedalgolia.instantSearch.afterInitis emitted after the InstantSearch library is initializedalgolia.instantsearch.hitClickActionis emitted when a user clicks on an InstantSearch resultalgolia.instantSearch.onErroris emitted when the InstantSearch library. reports an erroralgolia.instantSearch.onRenderis emitted when all InstantSearch widgets have been renderedalgolia.instantsearch.beforeInitSortOrdersis emitted before InstantSearch sorting is initializedalgolia.instantsearch.beforeInitFacetsis emitted before InstantSearch facets are initializedalgolia.hooks.initializeis emitted before Algolia hooks have been initializedalgolia.analytics.beforeInitis emitted before the Algolia Insights API has been initialized
Example
Copy
1
2
3
document.addEventListener('algolia.autocomplete.afterInit', function() {
console.log("Autocomplete.js has been initialized")
});
Did you find this page helpful?