[GA4] Generate API secrets for Measurement Protocol

An API secret is one of the required URL parameters when you send events to Analytics via Measurement Protocol. You generate API secrets for each data stream you want to use to send events. You can generate up to 10 secrets per data stream.

Generate API secrets in Analytics Admin

  1. In Admin, under Data collection and modification, click Data streams.
    Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to generate API secrets.
  2. Click Web, then click a web data stream.
  3. In the web stream details, click Measurement Protocol API Secrets.
  4. If necessary, review and accept the User Data Collection Acknowledgement.
  5. Click Create.
  6. Enter a nickname for the secret, then click Create.
  7. Click Copy to copy the secret so you can paste it into your POST request.

Edit or delete an API secret

  1. In Admin, under Data collection and modification, click Data streams.
    Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to edit or delete an API secret.
  2. Click Web, then click a web data stream.
  3. In the web stream details, click Measurement Protocol API Secrets.
  4. In the row for the relevant secret, click More
  5. Click Edit to edit the secret nickname.
  6. Click Delete to delete the secret.

Was this helpful?

How can we improve it?
false
Search
Clear search
Close search
Google apps
Main menu
16079774386310664520
true
Search Help Center
true
true
true
true
true
69256
false
false