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

# Tealium

> Send events to the Algolia Insights API with Tealium.

export const Application = () => <Tooltip tip="An Algolia application is a self-contained environment with its own indices, configuration, and API keys. Applications don't share data or settings with each other.">
    application
  </Tooltip>;

If you're using Tealium to track user interactions on your website or app, you can set up the Algolia Insights connector to forward click and conversion events.

Algolia doesn't provide support for the Tealium connector, including installation or troubleshooting.
If you require help with this connector, refer to the [Tealium documentation](https://docs.tealium.com/server-side-connectors/algolia-insights-connector/)
or contact your Tealium team directly.

## Add the Algolia connector in Tealium

1. Sign in to [Tealium's Customer Data Hub](https://sso.tealiumiq.com/) and select the account and profile you want to work in.

2. On the sidebar, go to **Server-Side > EventStream > Event Connectors** and click **Add Connector**.

   <img src="https://mintcdn.com/algolia/uAYFrBCMSmYQz381/images/guides/tealium/1-connectors.png?fit=max&auto=format&n=uAYFrBCMSmYQz381&q=85&s=52397e20aec158bc9d90a38d0f27e0cd" alt="Screenshot of the Tealium Customer Data Hub interface showing the 'Event Connectors' page with a blue 'Add Connector' button and a 'Search' field." width="2560" height="1522" data-path="images/guides/tealium/1-connectors.png" />

3. In the **Connector Marketplace**, search for the Algolia Insights connector, select it, and click **Continue**.

   <img src="https://mintcdn.com/algolia/uAYFrBCMSmYQz381/images/guides/tealium/2-marketplace.png?fit=max&auto=format&n=uAYFrBCMSmYQz381&q=85&s=5f8866ccfbcf78f025c5cbe0a9764733" alt="Screenshot of the 'Connector Marketplace' dialog in Tealium, showing a search for 'Algolia' with one result: the 'Algolia Insights' connector." width="2560" height="1570" data-path="images/guides/tealium/2-marketplace.png" />

4. In the **Data Sources** menu, select **All Data Sources** if you want to forward events from all your websites or apps to Algolia,
   or select individual sources to only forward events from selected sources.

5. In the **Event Feed** menu, select the type of event you want to forward, such as, `product_view`, `cart_add`, or `purchase`.

6. Click **Continue**.

   <img src="https://mintcdn.com/algolia/uAYFrBCMSmYQz381/images/guides/tealium/3-source.png?fit=max&auto=format&n=uAYFrBCMSmYQz381&q=85&s=07ed8ce913cd1e7ea186ec1e60cbf0d9" alt="Screenshot of a Tealium dialog showing 'Select Source' with 'Data Source' set to 'All Data Sources' and 'Event Feed' set to a product view event." width="2560" height="1570" data-path="images/guides/tealium/3-source.png" />

7. Click **Add Connector**.

   <img src="https://mintcdn.com/algolia/uAYFrBCMSmYQz381/images/guides/tealium/4-configuration.png?fit=max&auto=format&n=uAYFrBCMSmYQz381&q=85&s=00a7c964de644af67dc5007cc7f96585" alt="Screenshot of a dialog titled 'Add Action - Algolia Insights' showing a 'Configuration' step with an 'Add Connector' button and 'Continue' at the bottom." width="2560" height="1570" data-path="images/guides/tealium/4-configuration.png" />

8. Go to the [Algolia dashboard](https://dashboard.algolia.com/explorer/browse) and select your Algolia <Application />.

9. Go to the [**API Keys**](https://dashboard.algolia.com/account/api-keys/) page and copy your application ID and search API key.

10. In the **Add Connector** dialog, enter a name for this connector and optional notes that help you identify this connector.
    In the **Authentication** section, enter your Algolia application ID and search API key.
    Click **Done**. Back on the **Add Action** dialog, click **Continue**.

    <img src="https://mintcdn.com/algolia/uAYFrBCMSmYQz381/images/guides/tealium/5-configuration.png?fit=max&auto=format&n=uAYFrBCMSmYQz381&q=85&s=c6d6c8ff51b1af655fb5b1de602dcd27" alt="Screenshot of a 'Connector Configuration' dialog with fields for 'Name', 'Notes', 'API Key', and 'Application ID' in a Tealium interface." width="2560" height="1570" data-path="images/guides/tealium/5-configuration.png" />

11. Enter a name for the action, and select an action type.

    In most cases, you want to send events as they happen, so select **Send Events (Real-Time)**.

    Select the **Event Type**: **Click** to track clicks on search results, **Conversion** for add-to-cart and purchase events.

    <img src="https://mintcdn.com/algolia/uAYFrBCMSmYQz381/images/guides/tealium/7-event-type.png?fit=max&auto=format&n=uAYFrBCMSmYQz381&q=85&s=f34c845454bf30d1d5cd683183107148" alt="Screenshot of a Tealium dialog configuring 'Send Events (Real-Time)' with 'Event Type' set to 'Click'." width="2560" height="1570" data-path="images/guides/tealium/7-event-type.png" />

12. [Map the Tealium event parameters](/doc/guides/sending-events/connectors/tealium#map-event-parameters) to their equivalent in Algolia.

    <img src="https://mintcdn.com/algolia/uAYFrBCMSmYQz381/images/guides/tealium/8-event-params.png?fit=max&auto=format&n=uAYFrBCMSmYQz381&q=85&s=4bdebeb1bc83c63eb29270e92cebc7d5" alt="Screenshot of an 'Add Action - Algolia Insights' dialog showing field mappings like event name and product ID to 'Object IDs'." width="2560" height="1570" data-path="images/guides/tealium/8-event-params.png" />

13. Repeat this process for each additional event you want to forward.

For more information about adding connectors,
see the [Tealium documentation](https://docs.tealium.com/server-side/connectors/add/).

## Enable `clickAnalytics`

To relate click and conversion events to searches,
Algolia needs a [query ID](/doc/guides/sending-events/guides/queryid).
To get the `queryID` parameter for a search,
set the [`clickAnalytics`](/doc/api-reference/api-parameters/clickAnalytics) parameter to `true`:

<CodeGroup>
  ```js JavaScript theme={"system"}
  const response = await client.searchSingleIndex({
    indexName: "INDEX_NAME",
    searchParams: {
      query: "YourSearchQuery",
      userToken: "user-1",
      clickAnalytics: true,
    },
  });
  const { hits, queryID } = response;
  console.log(hits, queryID);
  ```

  ```js InstantSearch.js theme={"system"}
  instantsearch.widgets.configure({
    clickAnalytics: true,
    userToken: 'user-1'
  });
  ```

  ```jsx React InstantSearch theme={"system"}
  import { Configure } from 'react-instantsearch';

  <Configure
    clickAnalytics={true}
    userToken={'user-1'}
  />
  ```

  ```html Vue InstantSearch theme={"system"}
  <ais-configure
    :click-analytics.camel="true"
    user-token.camel="user-1"
  />
  ```
</CodeGroup>

## Map event parameters

Algolia needs these extra parameters that aren't part of the Tealium event specifications:

| Parameter            | To           | Required?                                                                                                                                   |
| -------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `tealium_event`      | `Event Name` | Yes                                                                                                                                         |
| `index`              | Index        | Yes                                                                                                                                         |
| `tealium_visitor_id` | `User Token` | Yes. See [Personalization](/doc/guides/personalization/classic-personalization/personalizing-results#turn-on-personalization-in-production) |
| `queryID`            | `Query ID`   | Yes (for events related to search or browse requests)                                                                                       |
| `product_id`         | `Object IDs` | Yes                                                                                                                                         |
| `position`           | `Positions`  | Yes (for click events related to search requests)                                                                                           |

The next step is to [validate your events](/doc/guides/sending-events/guides/validate).
