view_search_results
RecommendedLog when a user is shown search results. On web streams this event can be collected automatically through Enhanced Measurement; in apps it is also exposed as a predefined Firebase Analytics event.
- Platforms
- web, app
- When it fires
- You send it when the action happens.
Parameters (3)
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| search_term | string | Yes | The search term used. | t-shirts |
| q_<i>[additional_query_parameter]</i> | - | - | Matches an additional query parameter you specify to be collected under advanced settings | - |
| unique_search_term | - | - | Only sends the unique_search_term parameter when it has a value of 1 (i.e. when the string is unique to that session) | - |
Example
gtag.js
gtag('event', 'view_search_results', {
search_term: 't-shirts',
q_<i>[additional_query_parameter]</i>: '...',
unique_search_term: '...',
});GTM dataLayer
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'view_search_results',
search_term: 't-shirts',
q_<i>[additional_query_parameter]</i>: '...',
unique_search_term: '...',
});