Skip to content

GTM Managed, Server Container

(Data Flow version Fully GTM Managed, using GTM Web Container) (Part 2 of 3)

Setting up GTM Server Container

In this step you will set up Google Tag Manager to trigger sending data to Google Analytics. The Server Container and the Web Container will have a shared "variable" with which they pass data. This data sharing occurs while respecting the visitors' consent.

For this step we will:

  1. Configure the GTM Client from the Server Container.
  2. Add a "variable" for the two containers to share Event Consent data.
  3. Add a "trigger" that checks if the variable has the 'Google Analytics value' which determines whether a visitor has given consents.
  4. Add a "tag" for GA4 (Google Analytics) that fires only if the trigger condition is true.

1. Configure the GTM Client from the Server Container.

Go to Google Tag Manager.

Ensure Correct GTM View: Server Container

  • We want to be on the Server Container
  • Make sure you are in the correct Google Tag Manager VIEW for this next step.
  • We want to make sure that we are in the "All Accounts" view of Google Tag Manager
  • click on the "Tag Manager" icon on the top-left of the screen
  • Next to the "Tag Manager" icon, you should see "All Accounts"
    (If you see "Web Browser Container" you are in the WRONG view for this next step...)

Step 1 screenshot

Click "Clients" in the left sidebar Step 2 screenshot

Click "New"

Step 3 screenshot

Click "Choose a client type to begin setup..." Step 4 screenshot

"Choose client type" - Click "Google Tag Manager: Web Container" Step 5 screenshot

"Client Configuration" - click "Add Container ID" Step 6 screenshot

"Allowed Container IDs" - Paste Web Browser Container ID

Locate your Web Browser Container ID

Reminder: to find your Web Browser Container ID, navigate to Web Browser Container ID.

Step 7 screenshot

Uncheck Region Specific Settings Step 7b screenshot

Rename "Untitled Client" as "GTM Client"

This needs to be exact. You can copy from here:

GTM Client

Step 8 screenshot

Click "Save" Step 9 screenshot

Click "Variables" in the left sidebar Step 10 screenshot

Under "User-Defined Variables, "click "New" Step 12 screenshot

Under "Variable Configuration," click "Choose a variable type to begin setup..." Step 13 screenshot

Select "Event Data" Step 14 screenshot

In "Key Path" type in "UcConsentAllowedDps"

This needs to be exact. You can copy from here:

UcConsentAllowedDps

Step 15 screenshot

Rename to "Event Data Consent Value"

Event Data Consent Value

Step 16 screenshot

Click "Save" Step 17 screenshot

3. Add a "trigger" that checks if the variable has the 'Google Analytics value' which determines whether a visitor has given consents.

Click "Triggers" on left sidebar Step 18 screenshot

Under "Triggers" - click "New" Step 19 screenshot

"Trigger Configuration" - "Choose a trigger type to begin setup..." Step 20 screenshot

"Choose trigger type" - click "Custom" Step 21 screenshot

Click "Trigger Configuration"

  • Clicking makes it expand with more options...

Step 22 screenshot

Click "Some Events" Step 23 screenshot

Click "Event Name" to expand the dropdown and select "Choose Built-In Variable..." Step 24 screenshot

Select "Choose Built-In Variable" - select "Client Name" Step 25 screenshot

Select "equals" from the second input menu Step 26 screenshot

Type in "GA4" into the third input

This needs to be exact. You can copy from here:

GA4

Step 27 screenshot

Click on "+" to add another Event row Step 28 screenshot

Select "Choose Built-In Variable"
You can now select "Event Data Consent Value"

Select "contains" from the second input menu

Paste "Google Analytics," (<= INCLUDE the Comma) into the third input

This needs to be exact. You can copy from here:

Google Analytics,

Step 29 screenshot

Rename "Untitled Trigger" to "GA4 Trigger" and click "Save" Step 33 screenshot

4. Add a "tag" for GA4 (Google Analytics) that fires only if the trigger condition is true.

Click "Tags" on left sidebar Step 35 screenshot

Under "Tags," click "New" Step 36 screenshot

You'll see an "Untitled Tag" page.
Under "Tag Configuration" click "Choose a tag type to begin setup..." Step 37 screenshot

Under "Choose tag type," click "Google Analytics" Step 38 screenshot

Under "Google Analytics," click "Google Analytics: GA4" Step 39 screenshot

Under "Measurement ID," paste Measurement ID info from Analytics

Locate your Measurement ID

Reminder: to find your Measurement ID, go to Web Stream, follow these directions to navigate to Web Stream, and "Web stream details" page.

Step 40 screenshot

Under "Untitled Tag"
In "Triggering" section, click "Choose a trigger to make this tag fire" Step 41 screenshot

Select "GA4 Trigger" Step 43 screenshot

Click "Save" and name your tag "Google Analytics GA4"

Google Analytics GA4

Step 44 screenshot

Click "Submit" Step 45 screenshot

Under Version Name, enter "Added GA4 Tag and Trigger" or something meaningful to you

Added GA4 Tag and Trigger

Step 46 screenshot

Click "Publish" Step 47 screenshot