Google Tag Manager – Google Analytics Anonymization
Google Tag Manager (gtm) can be used to integeratie ConsentCookie into your website. Combining gtm and ConsentCookie give website visitors the option to control which tags are loaded based on the consent they have given.
Google Analytics, a common gtm tag, has the option to collect data of your website visitors anonymously. We can combine gtm, ConsentCookie and the Google Analytics tag to enable or disable the anonymization config for Google Analytics based on the consent given by the website visitor.
The default configuration for the Google Analytics tag to enable anonymization looks as follow
Instead of a static value true
we can use ConsentCookie to check if a consent has been given and based on that enable or disable anonymization.
For example, Google Analytics is configured as opt-in but you still want to collect data anonymously when the website visitor has not yet given their consent for analytic purposes.
For that we need to first add a new user-defined variable that represent the consent value for Google Analytics. For that we use a Custom Javascript variable, with the following script
function(){
// Check if the consent has been given by the vistor
var isAccepted = ConsentCookie && ConsentCookie.get("ga").isAccepted();
// We want enable ip anonymization when no consent has been given
var enableAnonymizeIp = !isAccepted;
// return the value used as field value for gtm tag config
return enableAnonymizeIp;
}
And we can optimise this to
function(){
return !(ConsentCookie && ConsentCookie.get("ga").isAccepted());
}
The variable config will look as folllowAfter adding the new user-defined variable, save the changes and assign the variable to the Google Analytics tag.
After updating the Google Analytics settings make sure to update the trigger as well. When you used the knowledge base article to integrate ConsentCookie using gtm, the Google Analytics tag is triggered by a custom trigger that only is fired when the consent has been accepted for Google Analytics. Because we are using the anonymization option this is not a requirement.
You can use for example the default trigger Window Loaded
but any trigger would suffice as long as the Google Analytics tag is loaded after the ConsentCookie tag.
Effets Secondaires De Priligy Blog Propecia Vs Generic Finasteride viagra Viagra Discount Sales Viagra Trotz Bluthochdruck Cialis E Pressione Bassa
19 April 2019 at 01:58Purchase Medicine Online Viagra No Prescription In Usa viagra online pharmacy Viagra Receta Casero Viagra E Dipendenza
6 May 2019 at 10:03Propecia Importancia Amoxicillin Toxicity Canadian Health Club Viagara viagra Levitra 10 Mg Costo Where To Buy Prednisilone Propecia Significa Bueno
27 May 2019 at 13:54Finasteride Tablets For Sale Acquistare Kamagra Farmacia Levitra Bayern viagra online Posologia Viagra Generico Cephalexin No Prescription Dogs
9 September 2019 at 07:20online pharmacies
27 September 2019 at 09:06best online pharmacy
4 October 2019 at 08:44list of approved canadian pharmacies
10 October 2019 at 11:52canada drug pharmacy
10 October 2019 at 11:54canadian pharmacy viagra brand
10 October 2019 at 12:28no prior prescription required pharmacy
10 October 2019 at 12:35buy prescription drugs without doctor
10 October 2019 at 16:28prescription drugs online without
10 October 2019 at 23:54international pharmacies that ship to the usa
11 October 2019 at 00:31canadian pharmacies top best
11 October 2019 at 02:29online drugstore
11 October 2019 at 08:33prescriptions from canada without
11 October 2019 at 08:41canadian pharmacies mail order
11 October 2019 at 10:10best 10 online pharmacies
11 October 2019 at 11:17generic viagra without a doctor prescription
11 October 2019 at 11:20viagra without a doctor prescription
22 October 2019 at 11:16canadian pharmacies online prescriptions
22 October 2019 at 18:13canada pharmacies online
22 October 2019 at 22:21canadian pharmacies shipping to usa
22 October 2019 at 22:44legitimate canadian mail order pharmacies
22 October 2019 at 22:49canadian pharmacies online
22 October 2019 at 23:23buy prescription drugs without doctor
23 October 2019 at 02:56most reliable canadian pharmacies
23 October 2019 at 04:59canadian pharmacy
22 November 2019 at 04:58canadian pharcharmy online
22 November 2019 at 09:54online pharmacy canada
22 November 2019 at 10:40canadian pharcharmy online
22 November 2019 at 14:47canadian pharmacy
22 November 2019 at 15:41canadian pharmacies online
22 November 2019 at 17:59online pharmacies
22 November 2019 at 22:48online pharmacy canada
23 November 2019 at 00:45