This commit is contained in:
2025-05-13 12:26:36 -03:00
parent b4a0595869
commit 0f7b39c3cb

View File

@@ -69,18 +69,21 @@ const currency = new Intl.NumberFormat("pt-BR", {
target.disabled = true;
window.dataLayer?.push({ ecommerce: null }); // Clear the previous ecommerce object.
window.dataLayer?.push({
event: "add_to_cart",
currency: "BRL",
value: parseFloat(unit_price),
items: [
{
item_id: id,
item_name: name,
price: parseFloat(unit_price),
quantity: 1,
},
],
ecommerce: {
currency: "BRL",
value: parseFloat(unit_price),
items: [
{
item_id: id,
item_name: name,
price: parseFloat(unit_price),
quantity: 1,
},
],
},
});
const r = await checkout(item);