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.

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.

{ event: "Home Hero", gtm: { uniqueEventId: 30, ... }, ... }, { eventModel: { event_category: "Uniform Personalization", event_label: "pz-2-hero", is_control_group: 0, send_to: "GTM-5GBJFCC" } }

The three variables are:

  • Uniform event category
  • Uniform event label
  • Uniform is control group

The categories will be:

  • Uniform personalization
  • Uniform A/B testing

The same applies for the event label and control group.

Configuration for event category.
Configuration for event label.
Configuration for event control group.

Go to the "Triggers" section in Google Tag Manager. Create a new trigger.

Where to configure triggers.

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
Configuration for triggers.

In the tags section, click the New button and add a tag for "GA4 Uniform context proxy".

Create a new tag.

Configure the parameters and event names for each of the variables you created:

Name of elementConfiguration
Tag typeGoogle Analytics: GA4 Event
Event name{{Event}}
Event parameters
Parameter nameValue
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.

Configurations for event parameters.

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.