Google Analytics

A 3-post collection

Measure how many of your visitors that are using Adblock - and Ghostery

I had the great pleasure of meeting Daniel Carlbom, a senior data analyst at NetBooster, while at the  Google Analytics Conference Nordic 2015 in Stockholm. He gave a talk on how to measure how many of the visitors to your site are using adblock. Using this script, you get a fairly good benchmark on how many of your visitors will never see the ads you are buying. This in turn should be used to analyze the segments of users that are difficult to reach via conventional online ads and therefore should be targeted by different means.

One hypothesis can be that more people have adblock on their personal computer than at home. If this is the case, those users should be targeted during working hours. What browser are the adblockers using, and on what device? Whatever you decide to analyze, it is important to know the share of your own visitors that are using adblock.

Although measuring this is important, it can also be inherently difficult. Particularly as an increasing number of people are installing the Ghostery add-on, making it possible to «choose whether you want to block tracker-by-tracker, site-by-site, or a combination of the two». This often means that both Google Tag Manager and Google Analytics are being blocked and thus prevented from tracking the visit.

In the ideal world, we would like to know how many are using an adblocker and how many of our visitors have Ghostery installed, and it should look something like this in Google Analytics

Users with adblocker or GhosteryUsers with adblocker or Ghostery

Taking this a bit further

Using the method devised by Daniel to determine if an adblocker is present, we can build on this to also include a method to guess if the Ghostery add-on is installed.

Nick Nikiforakis has done most of the work for us when it comes to detecting Ghostery, update this to look for the title-attribute instead of the element id.

Because Ghostery often prevents Google Tag Manager and Google Analytics from loading, recording if the user has blockers installed has to be done in the background.

Enter the proxy page

The first time a user visits the site, javascript checks if adblock and/or Ghostery is installed. A small script then changes all the links on the page to a proxy-page that then registers the outcome of the adblock check with Google Analytics, before sending the user on its way to the original page. It is important to note that the call to Google Analytics should be handled in the background, so that the user can be sent on their way as soon as possible and not have to wait for the Google Analytics call to complete. The whole process can be illustrated like this

An illustration of how the detection of adblockers and Ghostery works with the proxy page on first visitAn illustration of how the detection of adblockers and Ghostery works with the proxy page on first visit

The proxy page sets a cookie that’s valid for 7 days before checking again for adblockers, it also sets a valid Google Analytics cookie that’s sent with the event. This cookie is then used later when the user visits the site again, either with directly with Google Analytics or via the proxy page.

An illustration of how the detection of adblockers and Ghostery works with the proxy page on second visitAn illustration of how the detection of adblockers and Ghostery works with the proxy page on second visit and when the cookie exists

There is a tiny cost with this solution as it sends the user to the proxy page before being redirected to the final destination, however, this shouldn’t cost more than 2 – 300 ms in addition to the extra redirect.

Using the cookie that’s set by the proxy page, the links are only changed and the user redirected to the proxy page every seven days. This means that the adblock check and Ghostery-check is run every seven days, which in turn enables us to see the trend over time if there is a change in adblock usage per user.

Using this data, it’s possible to deduce how many of your users will never see the ads you spend your money on and even try to segment them out in your audiences.

Google Analytics Conference Nordic 2015

I recently gave a talk at the Google Analytics Conference Nordic 2015 on how we went about implementing Google Tag Manager on a set of web applications. The focus of my talk was on documentation and routines, rather than the actual implementation of Google Tag Manager — which is really easy. This is a summary of that talk.

Data is everywhere and there are ever more applications and web services that provides solutions for collecting that data and generating insight based on those data. Most of these services are third-party services that relies on a service that you don’t have direct control over. Implementing these services exposes you to risks and knowing those risks is where your IT-security department is of great help. In order to


Google Analytics rockestjerne

En av oppgavene mine hos Storebrand som konverteringsansvarlig er å være en av Google Analytics rockestjernene. Det fine med det, er at det finnes så mange kloke hoder rundt om i verden som en kan lære fantastiske mengder av. Dette er en slags oppsummering av hva jeg har lært etter å ha vært på konferanse, deltatt på kurs og lest noen bøker. Noe av det jeg har lært er tekniske finurligheter om Google Analytics, men også hvordan produsere de gode analysene og hvordan finne svar på det en lurer på.

Kanskje det viktigste jeg har lært er at de beste dataene er de dataene du bruker og er kjent med. Ved å gjøre det til en daglig vane å bruke analysene, og sette av 10-15 minutter