Find your Google Measurement ID and API Secret
To configure Google Analytics 4 via Webhook, you will need your Google Measurement ID and API Secret. Note that the Measurement ID and the API Secret should be selected from the relevant data stream.
- Log in to Google Analytics.
- Click on Admin.
- Under 'Property', go to Data Streams.
- Click on the Data Stream you wish to connect to ActivatePro
- Copy your measurement ID. This will be needed in ActivatePro.
- Scroll down to events. Click on 'Measurement Protocol API Secrets".
- If you have not yet created an API Secret, create a new Secret.
- Copy your API Secret. This will be needed in ActivatePro
Configure Google Analytics via Webhook
- In the ActivatePro app, navigate to
Settings>Integrations. - Click the
Add new integrationbutton in the top right corner of the page. - Search for 'webhook' and click Set up.
- Using this information, you can now complete the setup form.
- Method: POST
- Destination URL:
https://www.google-analytics.com/mp/collect?measurement_id=<yourMeasurementId>&api_secret=<yourAPISecret>
- Authentication: No authentication
- Content type: application/JSON
In the JSON text, paste the following JSON body:
{
"client_id": "handlebar to fetch client id",
"user_id": "handlebar to fetch user id",
"events": [
{
"name": "event name",
"params": {
"param1": "xyz",
"param2": "xyz"
}
}
]
}
- Click 'Apply'.
You can now use this integration in a campaign. When using the integration in a campaign, update the campaign message with the handlebars, event name, and parameters.