Algolia Insights (Actions) Destination
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
- From the Segment web app, click Catalog.
- Search for “Algolia” in the Catalog, select it, and choose which of your sources to connect the destination to.
- Enter the “App ID” & “API Key” into your Segment Settings UI which you can find on the Algolia Dashboard, under API Keys menu.
To find your App ID, there are two options. You can find the App Id in the Application dropdown in the Dashboard.
The other location is where you will also find your API Keys. You can find your API Keys in your settings under API Keys, you will need a Search API Key to set up the Destination in Segment.
The Algolia Insights Destination is not a plug-and-play integration. It requires you to modify your frontend code to end additional Algolia-related data like index name or queryID.
To access your queryID, make sure clickAnalytics are enabled in your search event. If you’re using Insights.js this will look like
index.search('query', {
userToken: 'user-1',
clickAnalytics: true
})
Once this is enabled you will be able to send properties like queryId in your segment events. You can read more about how to send Algolia-related data to Segment from the documentation at Algolia.
Mapping Events
By default, Algolia has set up mappings for Product Clicked, Product Viewed and Order Completed events. If your event structure doesn’t match Segments V2 Ecommerce Spec you can update this by using the Mapping Tab.
Track
If you’re not familiar with the Segment Specs, take a look to understand what the Track method does.
Algolia supports the following events from Segment’s Ecommerce Spec.
Supported Events | Description |
Product Viewed |
Fire this event when a visitor views a product. |
Product Clicked |
Fire this event when a visitor clicks a product. |
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 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('Order Completed', {
index: "my-index-name",
queryID: "Algolia queryID", // required only for Click Analytics,
products: [
{
objectID: "hit objectID",
// ... 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: 30 Aug 2023
Need support?
Questions? Problems? Need more info? Contact Segment Support for assistance!