Search This Blog

Showing posts with label adblocks. Show all posts
Showing posts with label adblocks. Show all posts

Google Analytics, despite ad blockers

You have noticed that ad blockers also block Google Analytics in some valiant attempt to protect your privacy. If you're one of the normals then you use Analytics so you have some idea what is going on when people visit your website, not to create a vast database of users. Indeed Google Analytics itself anonymises some of its data to try to allay the fears of the truly paranoid.

You therefore need a way of tracking what is going on.

First, let's have a quick look at what is going on with the Analytics code.

Once you have created your property, you are told to add a code snippet to your pages:

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create','UA-12345678-90','auto');
ga('send','pageview');

My profile on StackExchange