How to properly send array data from GTM to sGTM

28 Views Asked by At

For a Matomo purchase tag, I'm sending this array from GTM to sGTM :

[
  [
    "id",
    "productName",
    "categoryName",
    50,
    1
  ]
]

The problem is that the data received by sGTM is converted to a string that looks like this :

"id,productName,categoryName,50,1"

How can I keep the same structure ? Should I transform the variable before sending it to the sGTM ?

Thanks for your help !

I tried to do a JSON.stringify before sending the variable but then I don't know how to convert it back.

0

There are 0 best solutions below