dono
dono

Reputation: 149

Is GA Measurement protocol getting updated

According to here,

https://support.google.com/analytics/answer/11583528?hl=en

GAU must be updated to GA4 properties. I'm using measurement protocol to send data to both GA4 and GAU properties. So in order to send measurement protocol to GA4 property should I update my existing measurement protocol apps?

I can send data to GA4 property using v=2, tid=G-xxxxxxx parameters at the endpoint /g/collect. Will any of this change?

Upvotes: 0

Views: 338

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117254

The Measurement Protocol (Universal Analytics) is not being updated it will probably be discontinued when UA stops recording hits.

The Measurement Protocol (Google Analytics 4) is still being developed. It does not open for all events.

const measurementId = `<measurement_id_value>`;
const apiSecret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurementId}&api_secret=${apiSecret}`, {
  method: "POST",
  body: JSON.stringify({
    "client_id": "XXXXXXXXXX.YYYYYYYYYY",
    "events": [{
      "name": "refund",
      "params": {
        "currency": "USD",
        "value": "9.99",
        "transaction_id": "ABC-123"
      }
    }]
  })
});

Upvotes: 0

Related Questions