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 with clickAnalytics: true) as properties.query_id on 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

FieldRequiredDescription
application_idYesYour Algolia application ID. Found in the Algolia dashboard under Settings > API Keys. Sent as the x-algolia-application-id header.
api_keyYesAn 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_nameYesThe Algolia index these events relate to (the same index your front-end queries). Set on every event as the index field.
regionYesInsights 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.

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

SignalSent asNotes
User tokenuserTokenThe Algolia anonymous token when collected, otherwise the Signal anonymous id. Must match the token the site sends with its searches.
Signed-in userauthenticatedUserTokenThe user id, only when it matches Algolia’s token pattern (no email addresses).
Query idqueryIDFrom 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 eventSent asEnabled
view_item_listProduct List ViewedYes
view_search_resultsSearch Results ViewedYes
select_itemProduct ClickedYes
view_itemProduct ViewedYes
add_to_cartProduct Added to CartYes
purchaseOrder CompletedYes
products_filteredFilter AppliedYes

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

ProblemSolution
422: objectIDsEvents need item ids: send items[].item_id equal to the index’s objectIDs.
Conversions not attributed to searchesSend the search response’s queryID as properties.query_id.

Limitations

  • At most 20 objects per event, as Algolia allows; further items are not sent.
  • search events without results are not sent; use view_search_results.