const PRODUCT_ITEM_SELECTOR = '.js-item-product'; LS.ready.then(function() { const PRODUCT_GRID_SELECTOR = '.js-product-table,.product-grid,.js-infinite-grid,.js-masonry-grid'; const itemListId = "category"; document.querySelectorAll(PRODUCT_GRID_SELECTOR).forEach(element => { element.addEventListener('click', function(event) { const product = event.target.closest(PRODUCT_ITEM_SELECTOR); if (!product) { return; } const id = product.dataset.productId; const name = event.target.closest('a')?.getAttribute('title'); if (!id || !name) { return; } gtagNsGA4('event', 'select_item', { items: [{ item_id: id.toString(), item_name: name, item_list_id: itemListId, item_list_name: ITEM_LIST_NAMES[itemListId] }] }); dataLayer.push({ ecommerce: null }); dataLayer.push({ event: 'select_item', ecommerce: { items: [{ item_id: id.toString(), item_name: name, item_list_id: itemListId, item_list_name: ITEM_LIST_NAMES[itemListId] }] } }); }); }); }); const PERSISTED_CONFIG_LOCAL_STORAGE_KEY = 'persisted_config'; function formatCartItemIntoGoogleAnalyticsItem(cartItem) { const cartItemId = cartItem.item_id ?? cartItem.id; const persistedConfig = JSON.parse(window.localStorage.getItem(PERSISTED_CONFIG_LOCAL_STORAGE_KEY) ?? '{}'); const itemListId = persistedConfig[`ga_item_list-${cartItemId}`] ?? CART_ITEM_LIST_ID; return { item_id: cartItem.variant_id.toString(), item_name: cartItem.name, item_variant: cartItem.short_variant_name, price: +((cartItem.unit_price / 100).toFixed(2)), quantity: Math.abs(cartItem.quantity), item_list_id: itemListId, item_list_name: ITEM_LIST_NAMES[itemListId], ...cartItem.google_item_categories }; }
5% OFF nos pagamentos via PIX
Filtrar

Filtrar por

Marca
Ver todos
Preço