i want to pull data from my datalayer in a Magento store, and store it as a variable in Google tag manager. I use the Welt pixel for creating data layer for the e-commerce data.
How can I put e.g. products.brand in a variable, so I can send it as a parameter in Google analytics 4.
I've tried to put in the following, in a variable - but non of them are right; ecommce.detail.products.brand, e-commerce.brand, products.brand
If I just put e-commerce, the whole array is being inserted as a variable.
Can anyone help me figuring this out?
{
ecommerce: {
detail: {
products: [
{
name: " Pinot Noir, Gaul",
id: "5704",
price: "150.00",
brand: "Matthias Gaul, Pfalz",
category: "Shoppen/Vine"
}
]
},
currencyCode: "DKK",
add: {
products: [
{
name: " Pinot Noir, Gaul",
id: "5704",
price: "150.00",
brand: "Matthias Gaul, Pfalz",
category: "Shoppen/Vine",
list: "Shoppen/Vine",
quantity: "6"
}
]
}
},