[GA4] Generate API secrets for Measurement Protocol

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

Generate API secrets in Analytics Admin

For web data streams

  1. Sign in to Google Analytics.
  2. 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.
  3. Click Web, then click a web data stream.
  4. In the web data stream details, click Measurement Protocol API Secrets.
  5. If necessary, review and accept the User Data Collection Acknowledgement.
  6. Click Create.
  7. Enter a nickname for the secret, then click Create.
  8. 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 data 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
Main menu
7231489036087053687
true
Search Help Center
true
true
true
true
true
69256
true
false
false
false