/
GA4 + GTM + Usercentrics V3

Usercentrics - PUBLIC

GA4 + GTM + Usercentrics V3

Configure Google Analytics 4 Measurement Id

  1. Open your Google Analytics account and navigate to Admin

    image-20210126-124839.png
  2. On the Admin Page, select Data Streams.

    image-20210126-125115.png

     

  3. In Data Stream, click 'Web' (if you're using Tag Manager on a webpage).

     

  4. Enter your page URL and name, then click Create Stream.

     

  5. After clicking Create Stream, a page with a Measurement ID will appear, which you can use in your Google Tag Manager account.

     

Configure Tag Manager

Create Google Analytics 4 tag

  1. On your Google Tag Manager, navigate to the 'Tags' tab and then click 'New' to proceed.

     

  2. Name the tag Google Analytics 4 tag, then click Tag Configuration and select Google Tag.

  3. Enter your Measurement ID in the "Tag ID" field (learn more here).

  4. Navigate to "Tag firing options" under "Advanced Settings" and select "Once per page".

    1. Explanation: If you want a certain technology to fire more than once per page view, you should set the tag firing option to "Unlimited". "Once per page", however, is Usercentrics' recommended setup.

  5. Save "Google Analytics 4 Tag".

     

Create Google Analytics 4 variable

To ensure that your non-IAB vendor scripts are not triggered without consent, follow these steps to create consent default status variables:

  1. Go to "Variables" in the side menu and select "User-Defined Variables," then click "New."

  2. Choose the variable type as "Data Layer Variable."

  3. Name the variable “Google Analytics 4 Variable” in the top-left field.

  4. For "Data Layer Variable Name," enter "Google Analytics 4" (exact spelling, capitalization, and hyphenation are required).

  5. Check the box for "Set Default Value" and set the default value to false.

  6. Save the "Google Analytics 4 Variable."

     

Create a Google Analytics 4 trigger

⚠️ Note: There are several ways to implement this logic. Usercentrics recommends the following option, however, depending on your setup, other structures might be more reasonable.

  1. Go to "Triggers" in the side menu and click "New."

  2. Choose "Custom Event" as the trigger type.

  3. In the top left, name the trigger "Google Analytics 4 Trigger."

  4. Check "Use regex matching" next to the "Event Name" field.

  5. In the "Event Name" field, enter consent_status.* ⚠️ Note: Ensure the spelling, hyphenation, and capitalization are exact.

  6. Select "Some Custom Events."

  7. In the condition settings, set: "Google Analytics 4 Variable" contains true. This ensures the trigger only fires if the user has opted in (variable=true).

  8. Save the trigger as "Google Analytics 4 Trigger."

    Finally, add the trigger to the "Google Analytics 4 Tag"

     

     

Related content

How do I Implement Usercentrics CMP V3 via Google Tag Manager template?
How do I Implement Usercentrics CMP V3 via Google Tag Manager template?
Read with this
GA4
More like this
How do I directly integrate the Usercentrics CMP V3 into my Google Tag Manager?
How do I directly integrate the Usercentrics CMP V3 into my Google Tag Manager?
Read with this
Understanding how the Usercentrics CMP and GCM operate
Understanding how the Usercentrics CMP and GCM operate
Read with this

Usercentrics - PUBLIC