Skip to content

Consent & tracking ​

With tracking events you see in the account portal which products were shown and clicked for a search, what goes into the cart and what is bought. Most events are only stored by Findiyra with the visitor's consent.

Base URL of all calls: https://api.findiyra.com/ais-search-api/v1

You get consent through your shop's cookie banner. Findiyra never asks the visitor itself, you only pass on the result.

Without consentWith consent
Only the search event that settles a searchAll events, e.g. shown and clicked products, cart and purchase

Events without the required consent are dropped by the API without an error.

Send it right away ​

If you know the decision on page load, send it as consent: with identify for a returning visitor, with the first search for a new one. The first search applies it when it creates the visitor.

json
{ "key": "YOUR_API_KEY", "uid": "USER_IDENTIFIER", "consent": true }

Change it later ​

If the visitor changes the decision in the cookie banner, report it right away.

js
await fetch(`${API_BASE}/ais-search-api/v1/store/consent`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ key: SHOP_KEY, uid: userIdentifier, consent: true }),
});
bash
curl -s -X POST "$API_BASE/ais-search-api/v1/store/consent" \
  -H "Content-Type: application/json" \
  -H "User-Agent: Mozilla/5.0" \
  -d "{\"key\": \"$SHOP_KEY\", \"uid\": \"$USER_IDENTIFIER\", \"consent\": true}" | jq

Which uid?

For identify and consent, uid is the user_identifier (from the first search response, stored for the next visit). For tracking, uid is the user_id instead.

Query the status ​

Shows what is stored for a visitor, e.g. for a privacy overview in your shop.

bash
curl -s -X POST "$API_BASE/ais-search-api/v1/store/consent-status" \
  -H "Content-Type: application/json" \
  -H "User-Agent: Mozilla/5.0" \
  -d "{\"shop_key\": \"$SHOP_KEY\", \"user_id\": \"$USER_ID\"}" | jq
json
{
  "success": true,
  "consent": true,
  "consent_updated_at": "2026-11-14T09:12:00.000Z",
  "anonymization_due_at": "2027-11-14T09:12:00.000Z",
  "events_count": 12
}

2. Tracking ​

All events go to the same endpoint, several at once if you like.

js
await fetch(`${API_BASE}/ais-search-api/v1/store/tracking`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  keepalive: true,
  body: JSON.stringify({
    key: SHOP_KEY,
    uid: userId,
    events: [
      { event_name: 'search', source: 'search', search_query: 'chair', search_request_id: result.search_request_id },
      { event_name: 'impression_search', source: 'search', search_query: 'chair', product_ids: result.data.suggestions.map((p) => p.id) },
    ],
  }),
});
bash
curl -s -X POST "$API_BASE/ais-search-api/v1/store/tracking" \
  -H "Content-Type: application/json" \
  -H "User-Agent: Mozilla/5.0" \
  -d "{
    \"key\": \"$SHOP_KEY\",
    \"uid\": \"$USER_ID\",
    \"events\": [{
      \"event_name\": \"click_search\",
      \"source\": \"search\",
      \"search_query\": \"chair\",
      \"product_ids\": [\"SW10013\"]
    }]
  }" | jq

keepalive: true makes sure the event arrives even when the visitor is just leaving the page, e.g. when clicking a product.

Events ​

event_nameWhenConsent needed
searchThe visitor settled a search, see Settle the searchno
empty_searchA search without hitsyes
impression_searchHits were shownyes
click_searchA hit was clickedyes
filter_searchA filter was setyes
viewA product page was openedyes
add_to_cartA product went into the cartyes
purchaseAn order was completedyes

Fields of an event ​

FieldDescription
event_nameSee the table above
sourceWhere the event comes from, search for the search
search_queryThe search term the event belongs to
search_request_idOnly for search: from the search response
product_idsProducts as a list, with the id from the search or your product number
product_idInstead of product_ids for a single product
revenueFor purchase: the revenue as a number, e.g. 129.99
filter_typesFor filter_search: the filters set, as a list, up to 20

Response ​

json
{ "success": true, "processed": 2 }

processed counts the stored events. Without consent it is e.g. 0, even though the request succeeded.

If the uid is unknown, the API responds with 403 and "Unknown or invalid session". This happens e.g. for a new visitor who has not searched yet: their user_id is only created by the first search.