Is there a measurement protocol for Google Analytics new property App+Web?

Viewed 780

Hi I am implementing Google Analytics App+Web new property and trying to send data from the backend to Google Analytics property. I could not find reference/documentation for sending hits to the App+Web property. In the measurement protocol documentation only list the protocol version v=1 while I assume the App+Web should be using v=2.

Does anyone know where I can find the documentation?

Thanks.

1 Answers

Now that the App + Web property has evolved into Google Analytics 4, the Measurement Protocol is also updating to v2, but it is back into Alpha stage.

I answered a similar question earlier, so I'll provide that here as well:

Here is the Documentation specifically for the Measurement Protocol for GA4

As you can see it is back into an Alpha stage, so the answer to "how soon will the new Google Analytics 4 properties be supported in the Measurement Protocol API" is however long it takes Google to move from Alpha to Beta and then to stable release– I would plan for quite a while.

To include some code, here is a snippet from that documentation of one way to submit an event. That being said, just like the Measurement Protocol v1 there will undoubtably be countless ways to send data to the new API.

const measurement_id = `G-XXXXXXXXXX`;
const api_secret = `<secret_value>`;

fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${measurement_id}&api_secret=${api_secret}`, {
  method: "POST",
  body: JSON.stringify({
    client_id: 'XXXXXXXXXX.YYYYYYYYYY',
    events: [{
      name: 'tutorial_begin',
      params: {},
    }]
  })
});
Related