Use the ecommerce datalayer for GA4 ecommerce

Hi,

I would like to trigger the GA4 “purchase” event through Piwik PRO TMS.
We use the Piwik PRO order_confirmation datalayer.

I created 1 datalayer variable per element.

And bellow event I would like to push:

<script>
  gtag("event", "purchase", {
    transaction_id: {{ DLV | Ecommerce | order_id }},
    value: {{ DLV | Ecommerce | grand_total }},
    currency: "EUR",
    items: [
     {
      item_id: {{ DLV | Ecommerce | product.sku }},
      item_name: {{ DLV | Ecommerce | product.name }},
      item_category: {{ DLV | Ecommerce | product.catagory }},
      price: {{ DLV | Ecommerce | product.price }},
      quantity: {{ DLV | Ecommerce | product.quantity }},
    }]
});
</script>

Make it sense?
If I have several products in my purchase, is it going to automatically add more item?

Many thanks,

Hello @ValPiwik ,
Did you have a chance to look into this article How to set up ecommerce tracking? - #2 by pp.support? The data layer structure is different, but it’s just a matter of adjusting the variables. Please make sure there is a loop that iterates through the cart (you need to add each product separately). You can use the tracker debugger to check if the variables were correctly assigned.

Thanks,
Piotr