Skip to main content

🟑 Phase 2 β€” ExtendedΒ Β·Β On-site search queries β†’ Meta Search + GA4.

search

When to push​

When an on-site search is run and results are displayed (not on keystroke).

Example​

window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
event: 'search',
search_term: 'hydrating cream',
ecommerce: {
items: [
// top 10 results max
{ item_id: 'BIO-CRM-001', item_name: 'Day Cream', price: 42.00, index: 1 },
// ...
]
}
});

Parameters​

ParameterRequired
search_termrequired β€” the query
ecommerce.itemsoptional β€” displayed results

Platforms​

PlatformNative eventNotes
GA4searchsearch_term is a standard GA4 parameter
MetaSearchmaps to search_string
Google Adsβ€”

search (for the query) + view_item_list with item_list_id: 'search_results' (for the results).

Pitfalls​

  • ❌ Pushing on every keystroke β†’ spam.
  • ❌ Skip zero-result searches? No, push them β€” valuable merchandising insight.