S
S
SET12020-11-06 15:16:47
Google Analytics
SET1, 2020-11-06 15:16:47

How to translate this Google Analytics code into Measurement Protocol?

I can’t figure out how to translate this code, which sends this data to Google Analytics, into the measurement format:

gtag("event", "purchase", {
  "transaction_id": "00001",
  "value": 5760.00,
   "items": [
    {
      "name": "...",
      "category": "...",
      "quantity": 1,
      "price": '5400.00'
    },
     {
      "id": "...",
      "name": "...",
      "brand": "...",
      "category": "...",
      "quantity": 2,
      "price": '180.00'
    }
  ]
  });


I just managed to do it myself:

https://www.google-analytics.com/collect?v=1&tid=G-XXXXXXXX&cid=xxxxx&t=purchase&ti=00001&ev=5760


but I don't know how to create the correct items array

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question