Configure Google Tag Manager
You need to ensure Google Analytics (GA) and Google Tag Manager (GTM) are correctly configured to show your data from Uniform, even if no code is needed other than the Google Tag Manager (GTM) ID. Google Analytics won't recognize events coming from GTM automatically.
Additional triggers and variables will also need to be configured and used within the connector tag.
Variables#
Go to the "Variables" section of Google Tag Manager.
You will configure three different variables, similar to how you have custom dimensions in GA. These are Data Layer Variables that are part of the "eventModel" in the JSON object. All variables will follow the format: eventModel.event_label
.
Here's an example JSON snippet.
The three variables are:
- Uniform event category
- Uniform event label
- Uniform is control group
Configuring variables#
The categories will be:
- Uniform personalization
- Uniform A/B testing
The same applies for the event label and control group.
Triggers#
Go to the "Triggers" section in Google Tag Manager. Create a new trigger.
You will configure triggers on all events with all names by entering ".+" in the "Event name" field and checking the "Use regex matching" box. Then you will select to fire the trigger on "Some custom events" by selecting that radio button and setting the following conditions to be true:
- Uniform Event Category
- Matches RegEx (ignore case)
- Uniform AB Testing|Uniform Personalization
Add tag for Uniform Context Proxy#
In the tags section, click the New button and add a tag for "GA4 Uniform context proxy".
Configure the parameters and event names for each of the variables you created:
Name of element | Configuration |
---|---|
Tag type | Google Analytics: GA4 Event |
Event name | {{Event}} |
Event parameters | |
---|---|
Parameter name | Value |
event_category | {{Uniform Event Category }} |
event_label | {{Uniform Event Label }} |
is_control_group | {{Uniform is Control Group }} |
You're basically done! Once you preview and submit these changes and you will start seeing data in your analytics.
Reviewing your data#
Open Google Analytics and navigate to Reports > Real-time overview. You should see data in "Event count by Event name." You can test by triggering events in your application and checking that your reports are incrementing as expected. The specific events will vary by project.