Skip to main content

Products Searched (product_searched)

Purpose: Track whenever a user performs a search either from the header search bar or the on‑page search interface. When to Fire: After you receive the search API response, immediately log how many results were returned along with contextual details (search term, location, filters, etc.). Payload Schema:
FieldTypeDescription
search_locationstringEither "quick" (header autocomplete) or "page".
search_termstringThe text the user searched for.
no_of_resultsnumberTotal number of search results (searchResponse.Data.total_count).
skuarray of stringsFlat array of all result SKUs.
search_sourcestringFor suggestion clicks, pass the autocomplete category key from the response (e.g., "popular_search", "recent_search").
used_suggestionstringThe exact suggestion text the user clicked (e.g., “shirts”, “jeans”).
facetsarray of objectsActive filters, each { field: <string>, value: <string> }.
request_idstringUnique identifier for the search request (x-request-id from response headers).
page_depthstringCurrent page number (1, 2, 3, etc.).

Clarification: autocomplete suggestions

  • search_source: set this to the suggestion category key returned by your autocomplete API for the clicked item (e.g., "popular_search", "recent_search", "category", "search_suggestion", etc.).
  • used_suggestion: set this to the exact suggestion text the user clicked (e.g., "shirts", "jeans").
Example: