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

# Choose how to send events

> Choose the best implementation path for sending click and conversion events to Algolia.

export const AcademyLink = ({href, title}) => {
  return <Card horizontal title="Algolia Academy" href={href} icon="square-play">Learn more about: {title}</Card>;
};

This page helps you choose how to send events to Algolia.
If you need an overview of events, `queryID`, and `userToken`, start with
[Click and conversion events](/doc/guides/sending-events).

<AcademyLink href="https://academy.algolia.com/training/0199aaf1-8024-7ae6-b4e7-07b8c5c098a3/overview" title="Send and Format Events to Power Smarter Search Experiences" />

## Start your implementation

The best way to send events to Algolia depends on where you're sending them from.
Use this page to choose your implementation path.

### Client-side versus server-side events

It's best to send events straight from your users' devices.
To do this, see [Send events from your frontend](#send-click-and-conversion-events-from-your-frontend) on this page.

If you're not collecting enough events compared to the number of visitors to your website or app,
it might be because your users use [**ad blockers**](https://wikipedia.org/wiki/Ad_blocking).
In this case, consider server-side tracking.

With server-side tracking, your users' devices send events to your servers.
Then your servers forward the events to the Insights API.
To set up server-side tracking, see [Send events manually or in batches](#send-events-manually-or-in-batches) on this page.

### Send click and conversion events from your ecommerce platform

If you're using any of these ecommerce platforms,
you can use the Algolia integrations to send events:

* [Adobe Commerce and Magento Open Source](/doc/integration/magento-2/how-it-works/events)
* [BigCommerce](/doc/integration/bigcommerce/search-settings/events)
* [Salesforce B2C Commerce](/doc/integration/salesforce-commerce-cloud-b2c/building-the-search-ui/events)
* [Shopify](/doc/integration/shopify/building-search-ui/events)

If you're using a **headless ecommerce** platform,
see [Send click and conversion events from your frontend](#send-click-and-conversion-events-from-your-frontend).

### Send click and conversion events from your frontend

If you're using Algolia's UI libraries,
you can use their Insights integrations to send events:

* [Autocomplete](/doc/ui-libraries/autocomplete/guides/sending-algolia-insights-events)
* [Flutter Helper](/doc/guides/building-search-ui/events/flutter)
* [InstantSearch Android](/doc/guides/building-search-ui/events/android)
* [InstantSearch iOS](/doc/guides/building-search-ui/events/ios)
* [InstantSearch.js](/doc/guides/building-search-ui/events/js)
* [React InstantSearch](/doc/guides/building-search-ui/events/react)
* [Vue InstantSearch](/doc/guides/building-search-ui/events/vue)

For domain-specific guidance, see:

* [Send ecommerce events with InstantSearch](/doc/guides/sending-events/instantsearch/send-ecommerce-events)
* [Send media events with InstantSearch](/doc/guides/sending-events/instantsearch/send-media-events)
* [Send generic events with InstantSearch](/doc/guides/sending-events/instantsearch/send-events)

To send events from pages that aren't search pages,
such as a shopping cart, use the [`search-insights`](/doc/libraries/search-insights) library for web apps.
For native Android and iOS apps, use the InstantSearch event guides listed above.

If you're not using Algolia's UI libraries,
use the `search-insights` library to send click and conversion events.

### Collect click and conversion events with customer data platforms or tag managers

These platforms can send events to the Algolia Insights API:

* [Segment](/doc/guides/sending-events/connectors/segment)
* [Google Analytics BigQuery Export](/doc/guides/sending-events/connectors/google-analytics-big-query-export)
* [Google Tag Manager](/doc/guides/sending-events/connectors/google-tag-manager)
* [Tealium](/doc/guides/sending-events/connectors/tealium)
* [mParticle](https://docs.mparticle.com/integrations/algolia/event/)
* [Rudderstack](https://www.rudderstack.com/docs/destinations/streaming-destinations/algolia-insights/)

### Send events manually or in batches

Use these resources if you need to send events manually,
forward them through your own servers,
or upload recent events from another system.

For more information, see:

* [Ecommerce event examples](/doc/guides/sending-events/api-client/send-ecommerce-events)
* [Media event examples](/doc/guides/sending-events/api-client/send-media-events)
* [Generic event examples](/doc/guides/sending-events/api-client/send-events)
* [Search Insights JavaScript library](/doc/libraries/search-insights)
* [Insights API](/doc/rest-api/insights)

### Upload events from external analytics

You can speed up data collection by uploading events **from the last four days**.
To upload historical events, you can use:

* The [`sendEvents`](/doc/libraries/sdk/v1/methods/send-events) method with Algolia's API clients
* The [Insights API](/doc/rest-api/insights)

For **Algolia Recommend**,
you can [upload a CSV file](/doc/guides/algolia-recommend/how-to/csv-upload)
with events from the last 90 days.

If an event needs a `queryID`,
its timestamp must be within an hour of the related search or browse request.
The `queryID` can't be from a search event older than four days.
For more information, see [Event types](/doc/guides/sending-events/concepts/event-types).

## See also

To learn more, see these blog articles:

* [Why collect events from day one](https://www.algolia.com/blog/engineering/why-you-should-capture-click-and-conversion-events-from-day-one/)
* [Five reasons to add events](https://www.algolia.com/blog/product/5-reasons-to-add-clicks-to-site-search-analytics-and-code-to-do-it/)
