Skip to main content

Tracking setup: Automatic with user consent

Last updated on Apr 22, 20263 min read

Step-by-step demo​

Step-by-Step Tutorial
Customize Google Tag Manager for auto-tracking with user consent

Start demo

Tracking Setup Wizard setting​

If you are in the Tracking Setup Wizard you choose the automatic analytics integration and want to use it with user consent, additional adjustments are required in GTM. Without these adjustments, no tracking events with user consent are sent to Google Analytics sent.

The setup wizard: „Google Analytics 4“ as the analytics tool, Google Tag Manager present, and the delivery method set to „Automatically“.

Adjustments to the Google Tag Manager​

1. start tracking on activation event​

Under Advanced Setup you will find the setting Start Tracking on Activation Eventwhich activated by default is. This setting separates the display of variants from tracking.

Varify tracking events are only pushed into the data layer when a specific Activate Tracking Script has been executed. This ensures that the events are only executed after a complete GA4 configuration be sent, whereby "Not Set" sessions be prevented.

If the GA4 configuration is also bound to a user consent, Varify events are only fired with user consent.

Important: An additional HTML tag must be created, which is fired after the GA4 configuration
-> see steps 2 & 3

Varify „Advanced Setup“ with an arrow on the menu entry and the switch „Start Tracking on Activation Event“ turned on.

2. create a new custom HTML tag in the GTM​

  1. Go to Tags in the Google Tag Manager and click on New. Now create a new custom HTML tag here.
  2. Name the tag: "Varify Activate Tracking"
  3. Paste the following code into the HTML field:
  4. Save the tag. Confirm that the day without trigger is to be saved.
<script>
if (window.varify && typeof window.varify.setTracking === 'function') {
window.varify.setTracking(true);
} else {
window.addEventListener('varify:loaded', function () {
window.varify.setTracking(true);
});
}
</script>
important

We have been using an updated Activate Tracking Script since 29.10.2025.
However, all previously implemented scripts remain valid and continue to function without any adjustments.

Google Tag Manager tag „Varify Activate Tracking“ of type Custom HTML with the script that calls window.varify.setTracking(true).

3. customize Google Tag configuration tag​

  1. Now go to your GA4 configuration tag and open it. Note: The easiest way to find it is to navigate to your tags and search for "Google Tag" with Ctrl+F
Google Tag Manager tag list with the „GA4 Config“ tag of type Google Tag highlighted.
  1. Click in the Tag Configuration area and select Advanced Settings and Tag Sequencing.
    1. now click on "Fire a tag after GA4 Config (The GA4 config tag) fires"
  2. Select the Varify Active Tracking Tag you have just created.
  3. Check the box below that says „Don’t fire” Varify Activate Tracking if GA4 Config “fails or is paused"
  4. Save the tag customization
The GA4 Config tag under Advanced Settings: tag sequencing set to fire „Varify Activate Tracking“ afterwards, and not to fire it if GA4 Config fails.

4. publish GTM Container​

To ensure that your adjustments in Google Tag Manager also work on your website, it is important to publish the changes.

To do this, go to "Overview" in the Tag Manager on the left. Here you can see an overview of all the elements you have just created.

To publish, click on the blue "Publish" button at the top right and confirm. The tag is now live and sends the data to your Google Analytics.

Google Tag Manager workspace with the „Submit“ button highlighted.

Display the A/B test data in Varify.io​

Check the tracking setup with an A/A test: Start an A/A test and check the tracking

Display the A/B test data in Varify.io​

With the Varify.io Google Analytics 4 Connection, you can easily display your results directly in your Varify.io dashboard. You can find out how to do this here: To the result evaluation in Varify.io

Viewing the A/B test data in GA4​

You can analyze the data of the variations of your A/B test in GA4 with the Explorative Data Analysis. You can find more information here: To evaluate the results in GA4