Google Analytics records hosted authentication events for one environment: sign-in, sign-up, and waitlist. Authdog sends them with the Measurement Protocol. You do not add the gtag snippet to the hosted pages yourself.

## Create the Measurement Protocol secret

1. In Google Analytics, open the GA4 property.
2. Copy the **Measurement ID** (`G-XXXXXXXXXX`).
3. Under **Admin > Data streams > your stream > Measurement Protocol API secrets**, create a secret and copy it.

## Enable the add-on

In the [Authdog console](https://console.authdog.com):

1. Select the project and environment.
2. Open **Authentication > Add-ons**.
3. Select **Google Analytics**.
4. Enter the **Measurement ID**.
5. Enter the **Measurement Protocol API secret**. It is write-only. Leave it blank on a later edit to keep the stored secret.
6. Enable the add-on and save.

By default Authdog forwards:

- `signin_success`
- `new_user`
- `email_password_signup_success`
- `user_joined_waitlist`

Development and production need their own properties, or at least their own streams, so test traffic does not land in the production property. Add-on configuration does not copy between environments.

## Test it

1. Sign up a user in the environment you configured.
2. In GA4, open **Realtime** and confirm the event arrives. Measurement Protocol events can take a short time to show outside Realtime.
3. Repeat a sign-in and confirm `signin_success` as well.

A missing Measurement ID is rejected when you enable the add-on. A wrong API secret makes Google drop the hit. Authdog still completes sign-in.

## Related

| Read | To learn how to |
| --- | --- |
| [Authentication add-ons](/docs/console/authentication) | Where Google Analytics sits next to the other add-ons |
| [Marketplace](/marketplace/google-analytics) | The listing for this integration |
