Skip to main content

Autocomplete Impression (ac_impression)

Purpose: Track when a user is shown autocomplete or suggestion data whether it’s recent searches, popular searches, category or product suggestions, or other content from your search‑suggestion API. When to Fire: Immediately after your autocomplete/suggestion API returns its response or before you render the suggestion dropdown or list. Payload Schema:
FieldTypeDescription
no_of_resultsnumberTotal number of suggestions length.
ac_sourcestringSource of suggestions (e.g. "search_suggestion", "popular_search", "recent_search", "category", "product", "content").
search_termstringThe user’s current search input.
itemsarray of stringsArray of suggestion identifiers (e.g. SKUs, category IDs, or free‑form suggestion strings).
Example:
// After your autocomplete API returns:
const sourceType       = 'popular_search';
const searchTerm       = 'running shoes';
const suggestionCount  = suggestions.length;      // e.g. 3
const suggestions      = suggestions.items;      // e.g. ['shirts','jeans','shoes']


ExpAnalyticsService.trackAcImpression({
  ac_source: sourceType,
  search_term: searchTerm,
  no_of_results: suggestionCount,
  items: suggestions
});