Algolia Insights Destination

Destination Info
Components
Connection Modes
Device-mode Cloud-mode
Web Web
Mobile Mobile
Server Server

Algolia Insights lets you push events related to how your product is being used. Sending those events is a required step for using several 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.

This document is about a destination which is in beta

This means that the Algolia Insights Destination is in active development, and some functionality may change before it becomes generally available.

Getting Started

  1. From the Segment web app, click Catalog.
  2. Search for “Algolia” in the Catalog, select it, and choose which of your sources to connect the destination to.
  3. Enter the “App ID” & “API Key” into your Segment Settings UI which you can find on the Algolia Dashboard, under API Keys menu.

NOTE: The Algolia Insights Destination is not a plug-and-play integration. It requires you to modify your frontend code to send additional Algolia-related data like index name, queryID, etc.

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

Track

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

Algolia supports the following six events from Segment’s Ecommerce Spec.

Supported Events Description
Product List Viewed Fire this event when a visitor views a product list or category.
Product List Filtered Fire this event when a visitor filters a product list or category.
Product Viewed Fire this event when a visitor views a product.
Product Clicked Fire this event when a visitor clicks 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 the Spec: V2 Ecommerce Events

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

analytics.track('Product List Filtered', {
    index: "my-index-name",
    filters: [
        { type : "free_delivery", value: "true" }
    ],
    // ... other required properties from the spec
})

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


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

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

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

Track calls will be sent to Algolia as a track event, and appear in your Click Analytics, A/B Testing and Personalization dashboard.

NOTE: If you send anonymous activity to Algolia, it will not be connected to activity attributed to that same user once they are identified.

Renaming Events

If you are already sending events of which the names are out of the spec, you need to rename them for Algolia to understand correctly. It doesn’t necessarily mean you need to modify your code.

Go to the destination settings and click “Rename Events”.

Destination Settings

You can put your current event names on the left and the event names following the spec on the right.

Rename Events

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 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
API Key
(required)
string. The Search API Key of your Algolia Application
App ID
(required)
string. The ID of your Algolia Application
Rename Events
(required)
text-map, defaults to {}.

(optional) Rename your events if your event names aren’t following the official Segment specification. Put your current event name in the left field, and the new name in the right field.

This page was last modified: 01 Jul 2022



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