Measuring purchase order - products

Hello,

I want to measure / track my purchases.

revenue, tax, shipping works, but the rest ( id, affiliation, + sku, name, price, quantity, category) doesn’t work.

Who can help me please?

I created this tag:

<script>
window._paq = window._paq || [];
var purchaseInfo = {{PurchaseInfo}};
window._paq.push(['trackEcommerceOrder',
purchaseInfo.orderId,
purchaseInfo.revenue,
purchaseInfo.subTotal,
(purchaseInfo.tax || 0),
(purchaseInfo.shipping || 0),
(purchaseInfo.discount || false)
]);
</script>

I also want to track the products from that purchase, but it won’t work.

I created this tag:

<script>
window._paq = window._paq || [];
var purchaseInfoProducts = {{PurchaseInfoProducts}};
window._paq.push(['addEcommerceItem',
purchaseInfoProducts.sku,
purchaseInfoProducts.name,
purchaseInfoProducts.price,
purchaseInfoProducts.quantity,
purchaseInfoProducts.category
]);
</script>

My Datalayer is this:

{
2
  ecommerce: {
3
    purchase: {
4
      actionField: {
5
        id: 'xxx',
6
        affiliation: 'xxx',
7
        revenue: 47.49,
8
        tax: 3.11
9
      },
10
      products: [
11
        {
12
          sku: 'xxx',
13
          name: 'xxx',
14
          price: 44.38,
15
          quantity: 1,
16
          category: 'xx'
17
        }
18
      ]
19
    },

Who can help me to track my purchase (id, affiliation, revenue, tax, + sku, name, price, quantity, category)? :interrobang:

Please help, thanks!

tauschn