Skip to main content

Autocomplete Clicks (ac_click)

Purpose: Track when a user selects or clicks on a suggestion in the autocomplete dropdown whether it’s a recent search, popular search, product recommendation, category, or other suggestion type. When to Fire: In the click handler for your autocomplete suggestions, immediately after the user selects one. Payload Schema:
FieldTypeDescription
ac_sourcestringType of suggestion clicked (e.g. "search_suggestion", "popular_search", "recent_search", "category", "product", "content").
used_suggestionstringThe actual suggestion text or identifier the user clicked (e.g. "jeans").
search_termstringThe user’s input at the time of click (e.g. "shi").
Example:
// In your autocomplete click handler:
const clickedSuggestion  = 'jeans';
const searchTerm         = 'jea';
const suggestionType     = 'search_suggestion';


ExpAnalyticsService.trackAcClick({
  used_suggestion: clickedSuggestion,
  ac_source: suggestionType,
  search_term: searchTerm
});