π‘ 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β
| Parameter | Required |
|---|---|
search_term | required β the query |
ecommerce.items | optional β displayed results |
Platformsβ
| Platform | Native event | Notes |
|---|---|---|
| GA4 | search | search_term is a standard GA4 parameter |
| Meta | Search | maps to search_string |
| Google Ads | β |
Recommended comboβ
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.