Algolia Insights (Actions) Destination

Destination Info
Partner Owned
  • This integration is partner owned. Please reach out to the partner's support for any issues.

With the Algolia Insights (Actions) destination, you can send Insights Events. It’s required to send Insight Events to use these Algolia features:

  • Click and conversion analytics
  • A/B Testing
  • AI Re-Ranking
  • Personalization
  • Algolia Recommend

This destination is maintained by Algolia. For any issues with the destination, contact the Algolia team.

Getting Started

  1. From the Destinations catalog page in the Segment App, click Add Destination.
  2. Search for Algolia in the Destinations Catalog and select the Algolia Insights (Actions) destination.
  3. Choose which Source should send data to the Algolia destination.
  4. Sign in to the Algolia dashboard and retrieve your App ID and API Key for the application you’d like to connect. See Getting your Algolia credentials below for details on where to get these values.
  5. Enter the App ID and API Key in the Algolia destination settings in Segment.

Getting your Algolia credentials

Your app ID and API key can be found in the API Keys section of your account settings in the Algolia dashboard. You will need a search API key to set up the destination.

Dashboard Settings

Settings Menu

Api Keys

The Algolia Insights Destination is not a plug-and-play integration. It requires you to modify your frontend code to add additional Algolia-related data like an index name and a query ID.

To access your query ID, make sure clickAnalytics is enabled in your searches. If you’re using our JavaScript search API client, this will look like:

index.search('query', {
  userToken: 'user-1',
  clickAnalytics: true
})

Once this is enabled, you will be able to access queryID in your search response, which you can then use in your Segment events.

You can read more about how to send Algolia-related data to Segment in the Algolia documentation.

Mapping Events

By default, Algolia has set up mappings for Product List Filtered, Product Clicked, Product Viewed, Product Added and Order Completed events. If your event structure doesn’t match Segment’s Ecommerce Spec, you can update this in the destination mappings section of the Segment app.

Mappings Tab

Track

If you’re not familiar with the Segment spec, take a look to understand what the Track method does.

Algolia supports the following Segment events out of the box:

Supported Events Description
Product List Filtered Send this event when a visitor filters a product list or category.
Product Clicked Fire this event when a visitor clicks a product.
Product Viewed Fire this event when a visitor views a product.
Product Added Fire this event when a visitor adds a product to their shopping cart.
Order Completed Fire this event whenever an order/transaction was successfully completed by the customer.

For a full list of required properties for each event type, see Spec: V2 Ecommerce Events

analytics.track('Product List Filtered', {
  search_index: "my-index-name",
  filters: [
    {
      attribute: "color",
      value: "yellow",
    }
  ],
  query_id: "Algolia queryID", // required only for Click Analytics,
  // ... other required properties from the spec
})

analytics.track('Product Clicked', {
  search_index: "my-index-name",
  product_id: "hit objectID",
  position: hitPositionOnIndex, // number
  query_id: "Algolia queryID", // required only for Click Analytics,
  // ... other required properties from the spec
})

analytics.track('Product Viewed', {
  search_index: "my-index-name",
  product_id: "hit objectID",
  query_id: "Algolia queryID", // required only for Click Analytics,
  // ... other required properties from the spec
})

analytics.track('Product Added', {
  search_index: "my-index-name",
  product_id: "hit objectID",
  query_id: "Algolia queryID", // required only for Click Analytics,
  // ... other required properties from the spec
})

analytics.track('Order Completed', {
  search_index: "my-index-name",
  products: [
    {
      product_id: "hit objectID",
      queryID: "Algolia queryID",
        // ...
    },
    // ... other required properties from the spec
  ]
})

If you send anonymous activity to Algolia, Algolia does not connect it to activity attributed to that same user once they are identified.

Engage

You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo.

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Engage sets that value to false.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

Real-time to batch destination sync frequency

Real-time audience syncs to Algolia Insights (Actions) may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

Setting Description
apiKey
(required)
string. An API key which has write permissions to the Algolia Insights API
appId
(required)
string. Your Algolia Application ID.
QueryID QueryString Name string, defaults to queryID .

QueryString name you use for when storing the Algolia QueryID in a page URL.

This page was last modified: 11 Jul 2024



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account