Live data from Hacker News

The Google Analytics Setup I Use on Every Site I Build

philipwalton.com

41–50 of 108 posts

Re: The Google Analytics Setup I Use on Every Site I Build

#41

With the surge in Ad Blocking recently, part of me wonders how accurate the Google Analytics JavaScript tracker is today, and how accurate it will be in 5 years. I wonder if we'll see a trend back to server-side analytics soon.

I run a service called Blockmetry [0] that measures exactly that, directly from pageviews. Some numbers get published regularly [1]. The percentage from August (last public number) is 5.2% of non-bot JS-enabled pageviews did not fire the analytics tag.

The short answer is that it's significant on an aggregate level worldwide, but the reality is that it varies _massively_ by country, device, day of the week [2], and even different sections on the same site. Additionally, there is small percentage of pageviews that have JS disabled you have to account for. This analysis was on HN earlier today [4] saying 0.2% of pageview worldwide have JS disabled, but, again, with huge variation (notably, Tor, but elsewhere too).

Q4 numbers are not released yet, but the trend is generally up, with some notable drops. Get in touch if you want more info or to set it up on your site [5].

[0] https://blockmetry.com/ [1] https://blockmetry.com/weather [2] https://blockmetry.com/blog/weekday [4] https://blockmetry.com/blog/javascript-disabled [5] https://blockmetry.com/contact

Re: The Google Analytics Setup I Use on Every Site I Build

#42

Remember that it's mandatory to disclose to visitors that your site uses Google Analytics in their T&C's https://www.google.com/analytics/terms/us.html (section 7, 'Privacy'). I don't see a privacy policy on this Google employee's page but perhaps they have a special exemption? Anyhow, for many websites you'll get more accurate traffic data with GoAccess parsing your logs and showing you page views and basic demograp…

> for many websites you'll get more accurate traffic data with GoAccess parsing your logs and showing you page views and basic demographic data Yes but remember that bot traffic may be more of an issue when analysing server side logs (a lot of bots still don't execute JavaScript). It's hard to know how effective the bot filtering features in GoAccess are compared with those of Google Analytics.

There is an --ignore-crawlers option that works well for me. Next thing I'll try to get working is to have the --ignore-referer= option parse Piwik's referer spam blacklist https://github.com/piwik/referrer-spam-blacklist

Re: The Google Analytics Setup I Use on Every Site I Build

#43

Remember that it's mandatory to disclose to visitors that your site uses Google Analytics in their T&C's https://www.google.com/analytics/terms/us.html (section 7, 'Privacy'). I don't see a privacy policy on this Google employee's page but perhaps they have a special exemption? Anyhow, for many websites you'll get more accurate traffic data with GoAccess parsing your logs and showing you page views and basic demograp…

> for many websites you'll get more accurate traffic data with GoAccess parsing your logs and showing you page views and basic demographic data Yes but remember that bot traffic may be more of an issue when analysing server side logs (a lot of bots still don't execute JavaScript). It's hard to know how effective the bot filtering features in GoAccess are compared with those of Google Analytics.

> a lot of bots still don't execute JavaScript

I operate a service that measures this (see another comment on this discussion), and all I'll say is you'll be very surprised how many bots actually execute JS, especially stealth bots. You have to be careful either way.

Re: The Google Analytics Setup I Use on Every Site I Build

#44

Earlier quoted context omitted.

Honestly, I prefer the Google Analytics setup. People who block my tracking scripts don't want to be tracked, so I won't track them. I use that info to see how people use a product, how they interact with it and what I can do to improve it. Where my time and money will be best spent. If people want to block them, that's fine, I'm not going to try and get around them, but their "voice" is also muted here. I'm no longe…

I think the question is: Do you know what percentage of your visitors that applies to? I don't disagree with your mindset at all, but could you be missing out on a large percentage of users and now know about it?

I very well could, but I'm not going to find out. All it takes is one blogger somewhere to see that I collect stats like "70% of my visitors block tracking" and then the smear pieces start with wonderful headlines like "X tracks users that explicitly disabled tracking" and I lose a significant portion of my user base.

I've had it happen before, i'm not going to make the same mistake again.

It's kind of a hamfisted approach, but if you block tracking, i'm going to treat you like you don't exist. It's not that i'm trying to punish anyone, it's just that the analytics seems to be the ONLY reliable source of getting any kind of information about what people use. Surveys only reach an extremely small subset, or nobody at all (i've had them get a 0% response rate while there were tens of thousands of daily users), unsolicited feedback is almost 100% negative and a large percentage of it nonsensical (things like "I hate the new update"... What am I supposed to do with that?), requests for feedback on new features or changes might get a few good responses, but I have no way of comparing those responses with actual usage (especially when one gets linked on reddit and suddenly gets 10X the number of responses simply because it was linked on reddit). And then if you decide to go against what your 3 responses to a problem requested, you'll get more blog posts like "x asks for feedback, does whatever they want anyway". I'm sorry, but I'm done with that. I go by usage numbers and patterns only now.

Re: The Google Analytics Setup I Use on Every Site I Build

#46
Filtering out GA sessions with the language of "C" (versus actual languages like en-us, fr, etc.) goes a long way in filtering out GA spam.

This language code is 99% of the time associated with bots. I had one site where 20% of all the sessions in a given month was such fake traffic!

Re: The Google Analytics Setup I Use on Every Site I Build

#47

Earlier quoted context omitted.

> for many websites you'll get more accurate traffic data with GoAccess parsing your logs and showing you page views and basic demographic data Yes but remember that bot traffic may be more of an issue when analysing server side logs (a lot of bots still don't execute JavaScript). It's hard to know how effective the bot filtering features in GoAccess are compared with those of Google Analytics.

> a lot of bots still don't execute JavaScript I operate a service that measures this (see another comment on this discussion), and all I'll say is you'll be very surprised how many bots actually execute JS, especially stealth bots. You have to be careful either way.

> all I'll say is you'll be very surprised how many bots actually execute JS

Interesting. Do you have any numbers you can share?

Re: The Google Analytics Setup I Use on Every Site I Build

#48

Echoing what others are saying, I much prefer Google Tag Manager. Many clients use a CMS which make injecting dynamic variables into a page a bit of a pain if it's not done via rules at runtime. The Next Web has open-sourced its Google Tag Manager setup ( https://github.com/thenextweb/gtm ), which has things like Scroll Tracking, Engagement Tracking (riveted.js), Outbound Link Tracking and lots of other things that a…

Google Tag Manager is not very practical in cases where you want a secure website. It renders CSP useless because it requires all sorts of permissions like 'self' on scripts and CSS. It's good to have on the marketing webpage where no user content is displayed though.

Re: The Google Analytics Setup I Use on Every Site I Build

#49

Tag Manager is definitely preferable in my experience if you want to empower non technical people such as marketing to make their own changes on the fly without having to bother developers.

You clearly have a more skilled marketing team than the one I tried to work with using GTM. I ended up dropping it because rather than implementing tracking Javascript in a text editor I was having to do it in an obtuse GUI instead - marketing wouldn't go near it.
Post reply on HN