Algolia
Datafly Signal sends Algolia Insights events (views, clicks, add to cart, purchases, filter clicks) server-side for Click and Conversion Analytics, A/B testing, Dynamic Re-Ranking and Algolia Recommend.
Why route Algolia through Datafly Signal
- Events arrive when the browser cannot send them. Server-side delivery is not stopped by ad blockers, tracking prevention or a page unload.
- Conversions are complete. Purchases confirmed on the server are attributed to the searches that led to them.
Prerequisites
- An Algolia application id and a search API key.
- The index name the site queries.
- Your site sending the Algolia
queryID(search withclickAnalytics: true) asproperties.query_idon clicks and conversions after a search. - Optionally, Signal capturing the Algolia anonymous user token as
algolia_user_token, so events join the site’s search requests.
Configuration
| Field | Required | Description |
|---|---|---|
application_id | Yes | Your Algolia application ID. Found in the Algolia dashboard under Settings > API Keys. Sent as the x-algolia-application-id header. |
api_key | Yes | An Algolia API key with the search ACL (enough to push Insights events). Found under Settings > API Keys. Sent as the x-algolia-api-key header. Do not use the admin key. |
index_name | Yes | The Algolia index these events relate to (the same index your front-end queries). Set on every event as the index field. |
region | Yes | Insights API region host: us (insights.us.algolia.io) or de (insights.de.algolia.io). Must match the region of your Algolia application. |
Configure in Signal
Add the integration
Go to Integrations > Add Integration > Algolia.
Choose a preset
Ecommerce / Retail.
Enter the configuration
Fill in the fields in the table above.
Select consent categories
Choose the categories that gate search analytics for your site, typically analytics.
Save
Signal delivers the next matching event.
API Endpoint
POST https://insights.{us|de}.algolia.io/1/events
x-algolia-application-id: APPLICATION_ID
x-algolia-api-key: API_KEY{"events": [...]}, batched up to 1,000 events per request.
Identity Signals
| Signal | Sent as | Notes |
|---|---|---|
| User token | userToken | The Algolia anonymous token when collected, otherwise the Signal anonymous id. Must match the token the site sends with its searches. |
| Signed-in user | authenticatedUserToken | The user id, only when it matches Algolia’s token pattern (no email addresses). |
| Query id | queryID | From properties.query_id. |
Event Mapping
Ecommerce / Retail preset (ecommerce)
Algolia Insights events for search and discovery on a shop: product list and search result views, product clicks (with queryID and positions after a search), product views, add to cart and purchase conversions (objectData price, quantity and discount per item, value and upper-cased currency), and filter clicks. objectIDs come from items[].item_id and must be the objectIDs of the configured index. userToken is the Algolia anonymous token when the site collects it (collected_ids.algolia_user_token) and otherwise the Signal anonymous id; it must be the same token the site sends with its search requests for analytics, A/B tests, Dynamic Re-Ranking and Recommend to attribute events. queryID comes from properties.query_id, the queryID the search response returned (clickAnalytics: true). authenticatedUserToken is the user id when it matches Algolia’s token pattern.
| Signal event | Sent as | Enabled |
|---|---|---|
view_item_list | Product List Viewed | Yes |
view_search_results | Search Results Viewed | Yes |
select_item | Product Clicked | Yes |
view_item | Product Viewed | Yes |
add_to_cart | Product Added to Cart | Yes |
purchase | Order Completed | Yes |
products_filtered | Filter Applied | Yes |
To customise, edit the integration’s Field Mappings in the Management UI.
Example: a purchase
What Signal sends (rendered from the preset):
POST https://insights.de.algolia.io/1/events{
"events": [
{
"authenticatedUserToken": "crm-user-7",
"currency": "GBP",
"eventName": "Order Completed",
"eventSubtype": "purchase",
"eventType": "conversion",
"index": "products_gb",
"objectData": [
{
"discount": 10,
"price": 129.99,
"quantity": 2
},
{
"price": 20,
"quantity": 1
}
],
"objectIDs": [
"SKU-1",
"SKU-2"
],
"timestamp": 1758500000123,
"userToken": "anonymous-2f4e1a",
"value": 279.98
}
]
}Testing
Send a test event
Trigger the event on your site, or replay one from Signal’s event debugger.
Check the response
Confirm a 2xx response, then check the event in the Algolia dashboard under Data Sources > Events.
Troubleshooting
| Problem | Solution |
|---|---|
| 422: objectIDs | Events need item ids: send items[].item_id equal to the index’s objectIDs. |
| Conversions not attributed to searches | Send the search response’s queryID as properties.query_id. |
Limitations
- At most 20 objects per event, as Algolia allows; further items are not sent.
searchevents without results are not sent; useview_search_results.