search
RecommendedLog this event when a user performs a search. search_term is the core parameter. Travel and hospitality implementations can also send destination, origin, dates, passenger/room/night counts, and travel_class to add context.
- Platforms
- web, app
- When it fires
- You send it when the action happens.
Parameters (9)
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| search_term | string | Yes | The term that was searched for. | t-shirts |
| destination | string | No | Travel destination. | Madrid |
| origin | string | No | Travel origin. | A Coruña |
| start_date | string | No | Departure, check-in, or rental start date in YYYY-MM-DD format. | 2026-08-20 |
| end_date | string | No | Arrival, check-out, or rental end date in YYYY-MM-DD format. | 2026-08-24 |
| number_of_passengers | number | No | Number of passengers for a travel booking. | 2 |
| number_of_nights | number | No | Number of nights for a hotel booking. | 4 |
| number_of_rooms | number | No | Number of rooms for a hotel booking. | 1 |
| travel_class | string | No | Travel class. | business |
Example
gtag.js
gtag('event', 'search', {
search_term: 't-shirts',
destination: 'Madrid',
origin: 'A Coruña',
start_date: '2026-08-20',
end_date: '2026-08-24',
});GTM dataLayer
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'search',
search_term: 't-shirts',
destination: 'Madrid',
origin: 'A Coruña',
start_date: '2026-08-20',
end_date: '2026-08-24',
});