When you activate our Google Tag Manager connector, Axeptio will send 2 events to the dataLayer using the dataLayer.push() method.
The events sent to the dataLayer are:
- consent.display: The Axeptio widget has appeared on a page
- consent.answer: The user has interacted with the consent widget
Exemple :
dataLayer Variables for consent.answer
The consent.answer event sends 2 variables to the dataLayer:
privacy_consent_value
This parameter can have 3 different values:
- full: all cookies/third-party services are accepted by the user
- partial: some cookies are accepted by the user. Others are refused.
- refusal: all cookies/third-party services are refused by the user
privacy_consent_type
This parameter can have 2 different values:
- true: the user has accepted at least one cookie/third-party service
- false: the user has not accepted any cookies/third-party services
Setting up the Google Tag Manager Connector
Step 1: Creating in Google Tag Manager
Go to the Triggers menu to create 2 custom triggers:
- Custom Event: consent.display
- Custom Event: consent.answer
Go to the Variables menu to create 2 DataLayer variables:
- privacy_consent_value (In the screens: {{DLV - privacy_consent_value}})
- privacy_consent_type
Step 2: Creating your Tag
We will detail this step with a simple console.log to present the variables being sent, followed by the Google Analytics tag. Integration with Google Tag Manager allows you to send to any other tag. We have triggers and variables available. You are not limited to Google products.
Using a simple console.log();
When the user interacts with Axeptio, the consent.answer event is sent, which will serve as the trigger.
We add a custom HTML tag to display in the console the event name and the value of privacy_consent_value.
<script>
console.log( 'Event : {{Event}} , Privacy Consent Value : {{DLV - privacy_consent_value}} ');
</script>
Résultat
With Google Analytics 4
Add an event tag that will be triggered by consent.answer (it also works with consent.display).
There are 2 DataLayer variables created with consent.answer that we pass as parameters to the event to send them to Google Analytics.
Configuration to add the 2 dimensions in your Google Analytics 4 interface
In the setup/administration part of your Google Analytics account, go to the custom dimensions section.
Here is the result:
Verify the setup
You can launch a preview of your website. The debug_mode parameter of Google Analytics will be active. If you are only using Gtag, add the debug_mode in your config.
In Google Analytics, go to DebugView.
In another window, use the preview version in Google Tag Manager to display your website. After a few seconds, you will see your visit in Google Analytics and you will have the events sent by Axeptio.
Axeptio Events
Detail of the consent.answer event
Display your statistics in Google Analytics Explorer
You now have additional data recorded in Google Analytics. In the explorer section, you can create your dashboards.
- Display the number of widget appearances = Total consent.display events
- Interaction with the consent widget = Total consent.answer events
You can thus calculate your consent rate, interaction rate, and analyze the impact on your website.
Expansion with all tags
Google Tag Manager is a container; you can trigger and send this information to any partner that allows you to analyze your website. As we saw with the console.log, the data is available and you can send it wherever you want.