Google Analytics 4 changes some things like Events and introduces new concepts like User Properties. The Measurement Protocol API does not appear to have parameters to support the new Events or User Properties. Does it actually support Google Analytics 4 and if so, how do we submit the new information to that API? If it doesn't, how soon will the new Google Analytics 4 properties be supported in the Measurement Protocol API?
2 Answers
The link to the documentation you indicated refers to the measurement protocol v1, adopted by Universal Analytics.
The new GA4 property (App + Web) works with a new version of the measurement protocol, v2. It is a new feature that has already been announced by Google and will be launched over the next few weeks.
We still have to have some patience :)

- 13,567
- 3
- 25
- 42
I feel weird simply linking to documentation as an answer, but per the question of "Does it actually support Google Analytics 4" and "how do we submit the new information to that API", I feel this is the best way to answer.
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: {},
}]
})
});

- 3,971
- 4
- 20
- 28
-
1How do you obtain the API SECRET key? Google Documentation states that this is "An API SECRET generated from the Google Analytics UI." However I couldn't find this option anywhere. – claudiu.nicola Oct 26 '20 at 13:54
-
1To create a new secret, navigate in the Google Analytics UI to: Admin > Data Streams > choose your stream > Measerement Protocol > Create ([link here](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference#payload_query_parameters)) Doesn't really help, because there is no option to generate a secret API key... – claudiu.nicola Oct 26 '20 at 14:17
-
1Is this safe to call this on browser? -> is it ok for the api_key to be exposed on network developer tool? or is GA4 designed for server side usage only? – softmarshmallow May 19 '21 at 11:09