> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify Algolia global events

> The global events emitted by the InstantSearch and Autocomplete libraries.

<Warning>
  The events `algolia.instantsearch.hitClickAction` and `algolia.autocomplete.hitClickAction` are deprecated since March 31, 2025.
  Use [`beforeInstantSearchProductTemplate`](/doc/integration/shopify/building-search-ui/instantsearch-hooks#beforeinstantsearchproducttemplate) and
  [`beforeAutocompleteProductTemplate`](/doc/integration/shopify/building-search-ui/autocomplete-hooks#beforeautocompleteproducttemplate) events instead.
</Warning>

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.beforeInit`.

  Emitted before the Autocomplete library is initialized.

* `algolia.autocomplete.afterInit`.

  Emitted after the Autocomplete library is initialized

* `algolia.autocomplete.hitClickAction` (deprecated).

  **Deprecated.** Use `beforeAutocompleteProductTemplate`for adding click events.
  Emitted when a user clicks on an Autocomplete result

* `algolia.instantsearch.beforeInit`.

  Emitted before the InstantSearch library is initialized.

* `algolia.instantSearch.afterInit`.

  Emitted after the InstantSearch library is initialized.

* `algolia.instantsearch.hitClickAction` (deprecated).

  **Deprecated.** Use `beforeInstantSearchProductTemplate` for adding click events
  Emitted when a user clicks on an InstantSearch result

* `algolia.instantSearch.onError`.

  Emitted when the InstantSearch library reports an [error](/doc/api-reference/widgets/instantsearch/js#param-error).

* `algolia.instantSearch.onRender`.

  Emitted when all InstantSearch widgets have been [rendered](/doc/api-reference/widgets/instantsearch/js#param-render).

* `algolia.instantsearch.beforeInitSortOrders`.

  Emitted before InstantSearch sorting is initialized.

* `algolia.instantsearch.beforeInitFacets`.

  Emitted before InstantSearch facets are initialized.

* `algolia.hooks.initialize`.

  Emitted before Algolia hooks have been initialized.

* `algolia.analytics.beforeInit`.

  Emitted before the Algolia Insights API has been initialized.

## Example

```js JavaScript icon=code theme={"system"}
document.addEventListener("algolia.autocomplete.afterInit", function () {
  console.log("Autocomplete.js has been initialized");
});
```
