Aggregating Google Analytics Browser Statistics with r2d2
March 27, 2016
I love Google Analytics but the browser usage stats always annoyed me. Since modern, evergreen browsers release features very frequently, you end up having to combine multiple entries into one in order to get a more usable data. For example, when identifying the users on Chrome, I really don’t care how many of them are on Chrome 48 vs 49, I only care if they are on Chrome.
It uses the Google Analytics API to connect to your dashboard. Reads the browser stats from the last 30 days and prints out in an aggregated manner. The rules are, of course, very customised to my needs but the code itself is very easy to change if you need a different output.
I wrote it using some ES2015 features like:
let, const, import and
template strings. It’s all up on GitHub so feel free to have a look.
I’m a Brazilian front-end developer living in London. This website features some of my latest projects and my thoughts on anything web related.
You can find me on Twitter, Instagram, and LinkedIn