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
1. Consent
You get consent through your shop's cookie banner. Findiyra never asks the visitor itself, you only pass on the result.
| Without consent | With consent |
|---|---|
Only the search event that settles a search | All 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.
{ "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.
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 }),
});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}" | jqWhich 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.
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{
"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.
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) },
],
}),
});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\"]
}]
}" | jqkeepalive: true makes sure the event arrives even when the visitor is just leaving the page, e.g. when clicking a product.
Events
event_name | When | Consent needed |
|---|---|---|
search | The visitor settled a search, see Settle the search | no |
empty_search | A search without hits | yes |
impression_search | Hits were shown | yes |
click_search | A hit was clicked | yes |
filter_search | A filter was set | yes |
view | A product page was opened | yes |
add_to_cart | A product went into the cart | yes |
purchase | An order was completed | yes |
Fields of an event
| Field | Description |
|---|---|
event_name | See the table above |
source | Where the event comes from, search for the search |
search_query | The search term the event belongs to |
search_request_id | Only for search: from the search response |
product_ids | Products as a list, with the id from the search or your product number |
product_id | Instead of product_ids for a single product |
revenue | For purchase: the revenue as a number, e.g. 129.99 |
filter_types | For filter_search: the filters set, as a list, up to 20 |
Response
{ "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.