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 iOS data streams
- Sign in to Google Analytics.
- 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.
- Click iOS, then click an iOS data stream.
- In the iOS data stream details, click Measurement Protocol API Secrets.
- If necessary, review and accept the User Data Collection Acknowledgement.
- Click Create.
- Enter a nickname for the secret, then click Create.
- Click
to copy the secret so you can paste it into your POST request.
Edit or delete an API secret
- 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.
- Click iOS, then click an iOS data stream.
- In the iOS data stream details, click Measurement Protocol API Secrets.
- In the row for the relevant secret, click
.
- Click Edit to edit the secret nickname.
- Click Delete to delete the secret.