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.
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.
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
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".