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:45Hi! This is my first visit to your blog! We are a team of volunteers and starting
14 March 2020 at 22:14a new initiative in a community in the same niche.
Your blog provided us valuable information to work on. You have
done a marvellous job!
Pretty section of content. I just stumbled upon your website
11 April 2020 at 18:37and in accession capital to assert that I acquire in fact enjoyed
account your blog posts. Anyway I will be subscribing to your
augment and even I achievement you access consistently fast.
I savor, cause I found exactly what I used to be looking for.
18 April 2020 at 13:24You have ended my 4 day long hunt! God Bless you man. Have a great day.
Bye
It’s very simple to find out any topic on web as compared
to textbooks, as I found this post at this web page.
P.S. If you have a minute, would love your feedback on my new website
re-design. You can find it by searching for «royal cbd»
— no sweat if you can’t.
Keep up the good work!
15 May 2020 at 23:08Знаете ли вы?
Будущего чемпиона Европы по боксу в детстве одновременно дразнили «хохлом» и «москалём».
Старейший депутат Палаты представителей проработал в Конгрессе США почти до 92 лет.
Американский лейтенант из конвоя PQ-17 был спасён советским танкером и наладил его оборону от авианалётов.
Российских легкоалетов могут сурово наказать за действия чиновников от спорта.
Иракский физрук получил мировую известность под псевдонимом «ангел смерти».
http://0pb8hx.com
15 June 2020 at 08:49Знаете ли вы?
Жизненный путь абсолютного большинства звёзд известен заранее.
Клирик-саксонец стать папой римским не захотел, а патриархом Севера не смог.
Биограф русского художника романтизировала историю его французской прародительницы вслед за Герценом.
Картина парада Победы, где руководство страны смещено на задний план, получила Сталинскую премию.
Первый футбольный трофей после начала пандемии коронавируса был разыгран в Таджикистане.
arbeca
21 June 2020 at 13:15Знаете ли вы?
В 1941 году в московскую «Писательскую роту» пришли добровольцами бывший вор и следователь ЧК.
Видеоигру с простейшей графикой называли и шедевром, и троллингом.
«Бикини» для лица помогает китаянкам уберечь кожу от медуз и загара.
Каждая шестая яркая галактика во Вселенной очень сильно испускает газы.
Хотя ареал белизского геккона состоит из нескольких крохотных островов, IUCN не считает его раздробленным.
http://arbeca.net
9 July 2020 at 12:08I truly love your blog.. Very nice colors & theme.
Did you create this amazing site yourself? Please reply back
as I’m looking to create my very own blog and would like
to learn where you got this from or just what the theme is called.
Cheers!
Also visit my web page :: best CBD for dogs
22 February 2021 at 13:31Yes! Finally someone writes about best cbd oil for
sleep.
Review my page – best cbd for sleep
22 February 2021 at 15:07Great site. A lot of useful information here.
22 February 2021 at 22:12I am sending it to some pals ans also sharing in delicious.
And naturally, thank you for your sweat!
certainly like your website however you have to take a
23 February 2021 at 01:52look at the spelling on quite a few of your posts.
A number of them are rife with spelling problems and I find it very
troublesome to inform the reality nevertheless I will definitely come again again.
I’ll immediately snatch your rss as I can’t find your e-mail
subscription hyperlink or newsletter service. Do you have any?
Please allow me understand in order that I could subscribe.
Thanks.
Feel free to surf to my webpage CBD for dogs
23 February 2021 at 03:24If you desire to grow your knowledge only keep visiting this web page and
be updated with the hottest news posted here.
Also visit my blog CBD for sale
23 February 2021 at 03:26My partner and I stumbled over here from a different website and thought I might as well check things out.
23 February 2021 at 04:56I like what I see so i am just following you.
Look forward to exploring your web page yet again.
It’s the best time to make a few plans for the longer term and it is
23 February 2021 at 05:06time to be happy. I have read this post and if I may just I desire to recommend you some interesting issues or suggestions.
Maybe you could write subsequent articles referring to this article.
I want to read more things about it!
Hi there, just became aware of your blog through Google, and
23 February 2021 at 09:16found that it is truly informative. I am gonna watch out for brussels.
I’ll appreciate if you continue this in future. Many people will
be benefited from your writing. Cheers!
If some one needs to be updated with most up-to-date technologies after that he must be pay a
23 February 2021 at 16:06quick visit this site and be up to date everyday.
Thanks for every other fantastic article. Where else could anybody get that
23 February 2021 at 21:58type of info in such an ideal means of writing? I’ve a presentation subsequent week, and I’m at the look for such information.
What’s up Dear, are you in fact visiting this website regularly, if so
23 February 2021 at 23:02after that you will without doubt get good know-how.
Howdy would you mind sharing which blog platform you’re working with?
24 February 2021 at 01:05I’m planning to start my own blog in the near future but I’m having a hard time
selecting between BlogEngine/Wordpress/B2evolution and
Drupal. The reason I ask is because your design and style seems
different then most blogs and I’m looking for something unique.
P.S Apologies for getting off-topic but I had to ask!