Advanced setup with Google Tag Manager

You want to create conditional controls for your tags triggers

If one of your tags is already triggered by a custom event, that you cannot replace with an Axeptio event (ex: an addToCart event), you can add a condition to your trigger with our variable.

A. Get our variable template

Go to the "templates" section and click on "Search Gallery"

Select the template called "Axeptio authorized vendors"

Click on "Add to workspace" then "Add" in the pop-in. The variable template is now added to your GTM.

B. Create a variable based on the template

You will now have to create a variable based on the template you just added. Go to the "variables" section and create a new one.

Click on "Variable Configuration" and select our template in the list.

Finally, name your variable and save it.

C. Add conditions to your triggers with the variable

The variable we created is an array containing in real time all cookies that have been accepted by the user. Thanks to this variable, we will be able to add conditions on triggers.

Here is a trigger example using this kind of conditions :

On your trigger, check the box "Some Custom Events", then select the variable you just created, then "contains", and finally the cookie's name you want to check.

Be careful, the cookie name is his technical name sent by our API, that can be found directly in your Axeptio admin, or by checking the dataLayer in the console.

Here is where to find the cookie name to add in your condition :

Go to your Axeptio admin, and click on the chosen cookie, you should be redirected to a page allowing you to modify its parameters, the field we're looking for is called "NAME".

You wish to trigger the deposit of a cookie when there is a click on a specific element of your page. User case: You wish to trigger the deposit of a cookie on click on the "download the booklet" button, but only if the user agreed with the deposit.

A. How can I do it?

1 - Create a variable

Connect to your Google Tag Manager account, then go to Variables, and create a new "User-defined Variables".

Choose "1st Party Cookie" as your variable type.

Name your tag, then in the "Cookie Name" box write: axeptio_cookies and check the "URL-decode cookie" box.

Congratulations, your variable is now created!

2 - Define two trigger conditions

Go back to the tags you want to modify or create new ones.

In the "Triggering" part, create a new trigger.

Select "Just Links" type.

Once this is done, you can condition the tag trigger with the user consent, with the help of our Axeptio variable and the "Vendor": true nomenclature, and by setting the maximal waiting time to 1 millisecond.

Finally, you can choose to trigger this tag on click on a specific class and on the URL

Warning, the specified class should be unique

B. Google Tag Manager Debug

If you have the slightest problem about locationg your class or elements that you want to track on GTM, you can use the debug mode on your website, that will show all elements detected by GTM when there is a click on your website.

To activate this mode simply go to your GTM and click on "Preview".

Congrats ! You can trigger all your actions in accordance with user choices and preferences.

Last updated