Skip to main content

πŸ”΄ Phase 1 β€” CoreΒ Β·Β Click-tracking from product lists.

select_item

When to push​

When the user clicks a product card in a list, before navigating to the PDP.

Example​

function onProductCardClick(product, listId, listName, position) {
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
event: 'select_item',
ecommerce: {
item_list_id: listId,
item_list_name: listName,
items: [
{
item_id: product.sku,
item_name: product.name,
item_brand: 'Biosphere',
item_category: product.category,
item_variant: product.variant,
price: product.price,
index: position,
quantity: 1
}
]
}
});
window.location.href = product.url;
}

Parameters​

ParameterRequired
item_list_idrecommended
item_list_namerecommended
items (1 item, the clicked one)required

index should match the one in the preceding view_item_list.

Platforms​

PlatformNative event
GA4select_item
Metaβ€”
Google Adsβ€”

Pitfalls​

  • ❌ Pushing multiple items β€” only the clicked one.
  • ❌ Navigating before pushing β†’ event lost. Push, then navigate (push is synchronous).