Algolia Insights Destination


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 analytics
  • A/B Testing
  • Personalization

This destination is maintained by Algolia. For any issues with the destination, please reach out to their team.

NOTE: The Algolia Insights Destination is currently in beta, which means that they are still actively developing the destination. This doc was last updated on February 20, 2020. If you are interested in joining their beta program or have any feedback to help improve the Algolia Insights Destination and its documentation, please let their team know!

Getting Started

The first step is to make sure Algolia Insights supports the source type and connection mode you’ve chosen to implement. You can learn more about what dictates the connection modes we support here.

Web Mobile Server
📱 Device-mode
☁️ Cloud-mode
  1. From your Segment UI’s Destinations page click on “Add Destination”.
  2. Search for “Algolia” within the Destinations Catalog and confirm the Source you’d like to connect to.
  3. Drop in the “App ID” & “API Key” into your Segment Settings UI which you can find from your 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 haven’t had a chance to review our spec, please 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.
analytics.track('Product List Viewed', {
    products: [{
        objectID: "hit objectID",
        position: "hit position on index",
        index: "my-index-name",
        queryID: "Algolia queryID" // required only for Click Analytics,
    }]
})

analytics.track('Product List Filtered', {
    index: "my-index-name",
    filters: [
        { type : "free_delivery", value: "true" }
    ]
})

analytics.track('Product Viewed', {
    objectID: "hit objectID",
    position: "hit position on index",
    index: "my-index-name",
    queryID: "Algolia queryID" // required only for Click Analytics,
})


analytics.track('Product Clicked', {
    objectID: "hit objectID",
    position: "hit position on index",
    index: "my-index-name",
    queryID: "Algolia queryID" // required only for Click Analytics,
})

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

analytics.track('Order Completed', {
    objectID: "hit objectID",
    index: "my-index-name",
    queryID: "Algolia queryID" // required only for Click Analytics,
})

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

Personas

You can send computed traits and audiences generated through Segment Personas to this destination as a user property. To learn more about Personas, reach out for a demo.

For user-property destinations, an identify call will be sent to the destination for each user being added and removed. The property name will be the snake_cased version of the audience name you provide with a true/false value. For example, when a user first completes an order in the last 30 days, we will send an identify call with the property order_completed_last_30days: true, and when this user no longer satisfies we will set that value to false.

When the audience is first created an identify call is sent for every user in the audience. Subsequent syncs will only send updates for those users which were added or removed since the last sync.

Settings

Segment lets you change these destination settings from your Segment dashboard without having to touch any code.

API Key

The Search API Key of your Algolia Application

App ID

The ID of your Algolia Application

Rename Events

(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.

Adding Algolia Insights to the integrations object

To add Algolia Insights to the integrations JSON object (for example, to filter data from a specific source), use one of the following valid names for this integration:

  • Algolia

  • Algolia Insights

This page was last modified: 03 Mar 2020

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