Algolia Tags extension overview

The Algolia Tags extension empowers marketers to easily set up rules that send user interaction data to Algolia, helping you deliver more personalized AI Search and Discovery experiences.

This extension is powered by a key feature:

  • Algolia Insights: Automatically captures and sends user interaction events to Algolia, which enables powerful analytics, personalized experiences, and improved search relevance.

Prerequisites prerequisites

You must have a valid Algolia account in order to use this extension. Go to the Algolia sign up page to create an account if you do not have one already.

Gather required configuration details configuration-details

To connect Algolia with Adobe Experience Platform, you’ll need the following information:

Credential
Description
Example
Application ID
Your Application Id can be found in the API Keys section of your Algolia Dashboard.
0ABCDEFG12
Search API Key
Your Search API Key can be found in the API Keys section of your Algolia Dashboard.
1234a12345678901b1234567890c1ab1

Install and configure the Algolia Insights extension install-configure

To install the Algolia Insights extension, navigate to the Data Collection UI and select Tags from the left navigation. From here, select a property to add the extension to, or create a new property instead.

Once you have selected or created the desired property, select Extensions in the left navigation, then select the Catalog tab. Search for the Algolia Insights card, then select Install.

In the configuration view that appears, you must provide the following details:

Property
Description
Application ID
Enter the Application Id you previously gathered in the configuration details section.
Search API Key
Enter the Search API Key you previously gathered in the configuration details section.
Index Name
The Index Name contains the Products or Content. This Index will be used as a default.
User Token Data Element
The Data Element that will return the User Token.
Authenticated User Token Data Element
Set the Data Element that will return the Authenticated User Token.
Currency Code
Enter the currency code in ISO-4217 format, such as USD or EUR. This field supports data elements.

Algolia Insights extension action types action-types

Algolia supports a set of predefined standard events, each with specific contexts and properties. The actions available in the Algolia extension align with these event types, making it easy to categorize and configure the events you send to Algolia based on their type.

Load Insights load-insights

NOTE
In most cases, it’s recommended to load Algolia Insights on every page of your site.

Add the Load Insights action to your tag rule wherever it makes the most sense for loading Algolia Insights based on your rule’s context. This action loads the search-insights.js library onto the page.

Create a new tag rule or open an existing one. Define the conditions according to your requirements, then select Algolia as the Extension and select Load Insights as the Action Type.

Property
Description
Insight Library Version
The Algolia Insights version. The default is 2.17.3.
User Opt Out Data Element
The Data Element that captures the user’s tracking preference.
Use User Token Cookie
Check this box to allow Algolia to generate a User Token cookie. By default, this option is set to true.

Clicked clicked

Add the Click action to your tag rule to send clicked events to Algolia. Create a new tag rule or open an existing one. Define the conditions according to your requirements, then select Algolia as the Extension and select Clicked as the Action Type.

Property
Description
Event Name
The Event Name that can be used to further refine this click event.
Event Details Data Element

The Data Element returns event details in JSON format, including:

  • indexName
  • objectIDs
  • queryID (optional)
  • positions (optional)
  • price (optional)
  • quantity (optional)
  • discount (optional)
  • objectData (optional)
  • currency (optional)
NOTE
If both queryID and positions are included, the event is classed as Clicked object IDs after Search. Otherwise, it’s classed as a Clicked object IDs event.


If the Data Element does not provide an indexName, the Default Index Name will be used when the event is sent.

For more information on the event categories, see the Clicked object IDs after search
and Clicked object IDs guides.

Converted converted

Add the Converted action to your tag rule to send converted events to Algolia. Create a new tag rule or open an existing one. Define the conditions according to your requirements, then select Algolia as the Extension and select Converted as the Action Type.

Property
Description
Event Name
The Event Name that will be used to further refine this convert event.
Event Details Data Element

The Data Element returns event details, including:

  • indexName
  • objectIDs
  • queryID (optional)
  • recordID (optional)
NOTE
If the Data Element contains queryId, the event is classed as Converted after Search. Otherwise, it will be classed as a Converted event.


If the Data Element does not provide an indexName, the Default Index Name will be used when the event is sent.

For more information on the event categories, see the Converted object IDs after search and Converted object IDs guides.

Added to Cart added-to-cart

Add the Added to Cart action to your tag rule to send added to cart events to Algolia. Create a new tag rule or open an existing one. Define the conditions according to your requirements, then select Algolia as the Extension and select Added to cart as the Action Type.

Property
Description
Event Name
The Event Name that will be used to further refine this add to cart event.
Event Details Data Element

The Data Element returns event details in JSON format, including:

  • indexName
  • objectIDs
  • objectData
  • price
  • quantity
  • discount (optional)
  • queryID (optional)
  • currency (optional)

.

NOTE
If the Data Element contains queryId, the event will be classed as Added to cart object IDs after Search. Otherwise, it will be classed as a Added to cart object IDs event.


If the Data Element does not provide an indexName, the Default Index Name will be used when the event is sent.


If the default Data Elements do not meet your requirements, a custom one Data Element can be created to return the desired event details.

For more information on the event categories, see the Added to cart object IDs after search and Added to cart object IDs guides.

Purchased purchased

Add the Purchased action to your tag rule to send purchased events to Algolia. Create a new tag rule or open an existing one. Define the conditions according to your requirements, then select Algolia as the Extension and select Purchased as the Action Type.

Property
Description
Event Name
The Event Name that will be used to further refine this purchase event.
Event Details Data Element

The Data Element returns event details in JSON format, including:

  • indexName
  • objectIDs
  • objectData
  • price
  • quantity
  • discount (optional)
  • queryID (optional)
  • currency (optional)

.

NOTE
The Purchased action retrieves event data from browser storage based on the purchased item IDs. If any of the purchased items contain a queryID in their stored data, the event will be classed as Purchased object IDs after Search. Otherwise, it will be classed as a Purchased object IDs event.


This approach allows the purchase event to automatically include all relevant context (query ID, index name, price, quantity, discount) from the user’s earlier interactions with the items.

For more information on the event categories, see the Purchased object IDs after search
and Purchased object IDs guides.

Viewed viewed

Add the Viewed action to your tag rule to send purchased events to Algolia. Create a new tag rule or open an existing one. Define the conditions according to your requirements, then select Algolia as the Extension and select Viewed as the Action Type.

Property
Description
Event Name
The Event Name that will be used to further refine this view event.
Event Details Data Element

The Data Element returns event details in JSON format, including:

  • indexName
  • objectIDs
NOTE
If the Data Element does not provide an indexName, the Default Index Name will be used when sending the event.

For more information on the view event, see the Viewed object IDs guide.

Algolia Insights extension data elements data-elements

Algolia supports a set of predefined data elements, each with specific contexts and properties. The following sections describes the data elements available in the Algolia Insights extension.

DataSet dataset

The DataSet Data Element retrieves data associated with HTML elements, which is then used in Algolia actions. This data element automatically stores the retrieved event data in browser storage for later use (such as in conversion or purchase events).

General Configuration:

Property
Description
Hit Element Div/Class Name
The HTML Element Name and/or CSS Class Name containing the dataset attributes including data-insights-object-id and optionally data-insights-query-id and data-insights-position on the HTML Element.
Index Name Element Div/Class Name
The HTML Element Name and/or CSS Class Name that has the dataset attributes (data-indexname) on the HTML Element.

Commerce Configuration (Optional):

Property
Description
Price Data Element
Data Element that returns the price for the item. If provided, this will be included in the stored event data for commerce events.
Quantity Data Element
Data Element that returns the quantity for the item. Defaults to 1 if not provided.
Discount Data Element
Data Element that returns the discount decimal value for the item.
Currency Code
The currency code in ISO-4217 format. If no currency code is specified, the default currency from the extension configuration will be used.

Overrides (Optional):

These fields allow you to override the default behavior of retrieving data from HTML dataset attributes.

Property
Description
Record ID Data Element
Override default approach to use page URL as the record ID. The record ID is used to store and look up data to send to Algolia for this product/page.
Query ID Data Element
The Query ID is retrieved from the dataset on the HTML element. To override this behavior, use this property to provide a data element that returns the Query ID as a string.
Object IDs Data Element
The Object IDs are retrieved from the dataset on the HTML element. To override this behavior, use this property to provide a data element that returns the Object IDs as an array.
Positions Data Element
The Positions are retrieved from the dataset on the HTML element. To override this behavior, use this property to provide a data element that will return the Positions as an array.
Index Name Data Element
The Index Name is retrieved from the dataset on the HTML element. To override this behavior, use this property to provide a data element that will return the Index Name as a string.

This Data Element returns:

{
  timestamp,
  queryID,
  indexName,
  objectIDs,
  positions,
  objectData,  // Optional: commerce data if price is provided
  currency,    // Optional: if provided
  recordID
}

An example of HTML that contains dataset:

<div data-indexname="acme_master_default_products" class="instant-search-comp__hits">
  <div class="hit-card"
    data-insights-object-id="${hit.objectID}"
    data-insights-position="${hit.__position}"
    data-insights-query-id="${hit.__queryID}">
    <h4 class="hit-name">...</h4>
  </div>
</div>

Query String query-string

The Query String Data Element extracts data from the URL query string to be used in Algolia actions.

Property
Description
Object ID Param Name
The query param name that contains the Object ID.
Index Name Param Name
The query param name that contains the Index Name.
Query ID Param Name
The query param name that contains the Query ID.
Position Param Name
The query param name that contains the Position.

This Data Element returns:

{
  timestamp,
  queryID,
  indexName,
  objectIDs,
  positions
}

An example of HTML that contains query parameters:

<a href="product.html?objectID=${hit.objectID}&queryID=${hit.__queryID}&indexName=${indexName}&position=${hit.position}">Read More</a>

Storage storage

The Storage Data Element retrieves data from the browser session storage for use in Algolia actions. This data element can also be used to augment the stored data with additional commerce information.

This Data Element retrieves event details that were previously stored in session storage (typically by the DataSet data element during click events). The data is automatically removed during conversion events unless the removal is explicitly disabled.

Overrides (Optional):

Property
Description
Record ID Data Element
The Record ID is used as a key to look up the event data that is stored in browser storage. The page URL is the default Record ID. To override this behavior, use this property to provide a data element that returns the Record ID as a string.
Price Data Element
Data Element that returns the price for the item. If provided, this will update the stored event data with price information.
Quantity Data Element
Data Element that returns the quantity for the item. If provided, this will update the stored event data with quantity information.
Discount Data Element
Data Element that returns the discount decimal value for the item. If provided, this will update the stored event data with discount information.
Currency Code
Enter the currency code in ISO-4217 format. If provided, this will update the stored event data with currency information.

This Data Element returns what is stored in the Session Storage, including any augmented commerce data:

{
  timestamp,
  queryID,
  indexName,
  objectIDs,
  positions,      // If available from original event
  objectData,     // Optional: commerce data if price is provided
  currency,       // Optional: if provided
  recordID
}

The Clicked after Search or Converted after Search events require a queryID, and positions is also required for Clicked after Search. These properties are available when the insights flag is enabled in InstantSearch and/or Autocomplete query parameters. Refer to the following resources to learn how to configure Insights for your site:

Next steps next-steps

This guide covered how to send data to Algolia using the Algolia Insights tag extension. If you are planning on also sending server-side events to Algolia, you can now proceed to install and configure the Conversions API event forwarding extension.

For more information on tags in Experience Platform, refer to the tags overview.

recommendation-more-help
12b4e4a9-5028-4d88-8ce6-64a580811743