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
Select a currency type. The default value is set to USD.

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.13.0.
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 false.

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, including:

  • indexName
  • objectIDs
  • queryID (optional)
  • position (optional)
Record ID Data Element
The Record ID is used as a key for the event data stored in the browser’s storage during a click event. By default, the page URL serves as the Record ID. To override this behavior, use this property to provide a data element that returns the Record ID as a string.
NOTE
If both queryID and position 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)
Disable Removal of Event Data
On a conversion event, the event data is removed from storage. If this data is needed for subsequent conversion events, disable the removal process to ensure the event data remains available.
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.
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 convert event.
Event Details Data Element

The Data Element returns event details, including:

  • indexName

  • objectIDs

  • objectData

    • queryID (optional)
    • price
    • quantity
    • discount
  • queryID (optional)

.

Currency
Select a currency type. The default value is set to USD.
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, including:

  • indexName

  • objectIDs

  • objectData

    • queryID (optional)
    • price
    • quantity
    • discount
  • queryID (optional)

.

Currency
Select a currency type. The default value is set to USD.
NOTE
If the Data Element contains queryId, the event will be classed as Purchased object IDs after Search. Otherwise it will be classed as a Purchased 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 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, 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.

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 optionallydata-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.
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 retreived from the dataset on the HTML element. To override this behaviour, use this property to provide a data element that will return the Positions as an array.
Index Name Data Element
The Index Name is retreived from the dataset on the HTML element. To override this behaviour, 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
}

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
}

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 Session Storage for use in Algolia actions.

This Data Element retrieves event details from Session Storage. No configuration is required. The data is automatically added during the click event action and removed during the convert event action.

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.

This Data Element returns what is stored in the Session Storage.

{
  timestamp,
  queryID,
  indexName,
  objectIDs
}

The Clicked after Search or Converted after Search events require a queryId, and position 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
f6b99685-516b-4038-9154-1bd568c76a99