Sub topic 6
Product discovery: view_item_list, select_item, and view_item
This chapter assumes you know the GA4 event and parameter model, the structure of the items array, and the standard item parameters. It also assumes you can add a gtag('event', ...) call to a page. Here you will apply that knowledge to the three events that describe how shoppers find products.
The three discovery events
Discovery events sit at the top of the shopping funnel. Together they answer three questions: which product lists were shown, which product was clicked, and which product page was opened.
| Event | Fires when | Key parameters | Items sent |
|---|---|---|---|
| `view_item_list` | A list of products is shown (category page, search results, "related products" block) | `item_list_id`, `item_list_name`, `items` | Every product visible in the list |
| `select_item` | The shopper clicks a product in a list | `item_list_id`, `item_list_name`, `items` | Exactly the clicked product |
| `view_item` | A product detail page is shown | `currency`, `value`, `items` | The one product on the page |
The first two describe a list. The third describes a product. view_item is the only one of the three that needs currency and value.
Sending view_item_list
Send one view_item_list event per list. Put the list's identity in event-level parameters, and put the products in items. Each item should also carry index, its 1-based position in the list, so you can report on position later.
gtag('event', 'view_item_list', {
item_list_id: 'running_shoes',
item_list_name: 'Running Shoes',
items: [
{
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
item_brand: 'Acme',
item_category: 'Shoes',
price: 24.99,
index: 1
},
{
item_id: 'SKU_1002',
item_name: 'Road Running Shoe',
item_brand: 'Acme',
item_category: 'Shoes',
price: 39.5,
index: 2
}
]
});Two choices matter here.
- Which products to include. Send the products the shopper could actually see. If a page shows 24 products, send 24. For infinite scroll or "load more", send a new
view_item_listfor each batch and continue theindexnumbering (25, 26, and so on). If you restart at 1, position reports will mix batches together. - How much to send. An event can carry a limited number of items, and the request has a size cap. Very long lists are better sent in batches than as one oversized event.
Sending select_item
When the shopper clicks a product, send select_item with the same list identity and only the clicked product. Do not resend the whole list.
document.querySelectorAll('[data-product-card]').forEach(function (card) {
card.addEventListener('click', function () {
gtag('event', 'select_item', {
item_list_id: card.dataset.listId,
item_list_name: card.dataset.listName,
items: [
{
item_id: card.dataset.sku,
item_name: card.dataset.name,
price: Number(card.dataset.price),
index: Number(card.dataset.position)
}
]
});
});
});The event can be lost if the click navigates away before the request is sent. gtag.js sends hits with the browser's beacon mechanism by default, which usually survives navigation. If you send hits another way, test a normal click and a middle-click to confirm the event arrives.
Sending view_item
On the product page, send view_item once when the page loads. Here value is the price times the quantity in the items array. For a product page the quantity is normally 1.
gtag('event', 'view_item', {
currency: 'USD',
value: 24.99,
items: [
{
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
item_brand: 'Acme',
item_category: 'Shoes',
item_variant: 'blue',
price: 24.99,
quantity: 1
}
]
});Always send currency when you send value. Without a currency code, GA4 cannot interpret the amount as money. Use the same item IDs and names here as in the list events and in later cart and purchase events. Otherwise you cannot join the funnel stages in reports.
Keeping list context through the funnel
The list a shopper came from is easy to lose. select_item records it, but the product page is a new page. If you want later events (view_item, add_to_cart, purchase) to be credited to the list, carry item_list_id and item_list_name inside each item object of those events. Common ways to do this are a query-string value, sessionStorage, or a server-rendered value on the product page.
var listContext = JSON.parse(sessionStorage.getItem('lastList') || '{}');
gtag('event', 'add_to_cart', {
currency: 'USD',
value: 24.99,
items: [
{
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
price: 24.99,
quantity: 1,
item_list_id: listContext.id,
item_list_name: listContext.name
}
]
});If a shopper adds a product without clicking through a list, leave the list fields out rather than inventing a value.
Reading the results
GA4 turns these events into item-scoped metrics in the Monetization reports. The ones relevant here are Items viewed, Item list views, Item list clicks, and Item list click-through rate. Dimensions such as Item list name, Item list ID, and Item list position let you break them down.
Sparse numbers usually point to a tagging gap. Item list views with no clicks suggest select_item is missing. Items viewed far above item list clicks can be normal, because shoppers reach product pages from search engines and email.
Common mistakes
- Sending
select_itemwith the full list initems. Reports then count clicks on every product. - Firing
view_item_listagain on every re-render of a single-page app. Guard with a flag so each list fires once per display. - Using different
item_idvalues for the same product across list and detail pages. - Sending
priceas a string such as"$24.99". Use a number. - Resetting
indexto 1 for each batch of a scrolling list.
Exercise
A category page loads 12 products, and the shopper scrolls to load 12 more. Then they click the 15th product. Describe the events you would send, including the index values and the number of items in each.
Show answer
Send a first viewitemlist with itemlistid and itemlistname and 12 items, index 1 to 12. After the second batch loads, send a second viewitemlist with the same list ID and name and 12 items, index 13 to 24. When the shopper clicks the 15th product, send one selectitem with the same list ID and name and a single item with index 15. On the product page, send viewitem with currency, value, and one item.