Tracking user interaction depending on prior consent
Hi,
I am strugling with this for some time now. I followed the guide integrating the GA pageview tag and using the consent trigger (cookieconsent_statistics) to make sure that pagviews are only tracked if a user has given his consent, which works fine.
There is aso a guide on how to use tags with several triggers. I also track clicks on e-mail adresses and phone numbers, which would be firing the tag even if the user has not given his consent for Google Analytics. The guide shows how to add a second condition for a custom event using "event equals cookieconsent_statistics". I tried to do that for click triggers and time triggers but it does not work. I added "event equals cookieconsent_statistics" as a second condition, which causes the tag not to fire at all, regardless if the consent has been given or not.
I am now wondering if this only works with custom events and not the predfined triggers for clicks, time, etc.. If it should work like, it would be great to get some feedback on how to make it work.
Best Regards,
Christoph
-
Hi Christoph,
The events like cookieconsent_statistics are only triggered on page load.
However, if you want to trigger anything after page load, like click on a link, you need to define a User-Defined-Variable of type "Custom JavaScript" in GTM that reads out the user's consent state on a cookie category, e.g. "Cookiebot.consent.statistics"function()
{
return Cookiebot.consent.statistics.toString()
}On his existing click-trigger you must then add the following firing condition: Cookiebot.consent.statistics equals true
Regards.
Spas0 -
I have a similar question, and also want to confirm that we need to add the cookie consent check for ALL events we are tracking within Tag Manager (not just GA Pageviews)?
If yes, does the cookiebot.consent.statistics variable need to be checked within the "This trigger fires on" section, or can it be a condition in the "Enable this trigger ..." section?
0 -
Hi Aurora,
You could not add cookie consent to check all events you are tracking with Google Tag Manager on your website. You should add cookie consent to the events which requires giving a consent regarding the GDPR rules (which set cookies on the site).
Actually, it should not matter how many instances/events of Google Tag Manager you are using. What matters is that you have created the triggers in each of the instances, and assigned these triggers to the relevant tags.Regards,
Spas0
Please sign in to leave a comment.
Comments
3 comments