Live data from Hacker News

Show HN: I replaced Google Analytics with simple log-based analytics

benhoyt.com

91–100 of 143 posts

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#92
post #9
post #6

If you're using JavaScript to add the pixel code, why not also include other metrics you can get easily with JS like screen resolution?

Yeah, good question. I wanted to do that, but GoAccess is a web server log parser and doesn't support custom fields (you don't get screen resolution via web logs, so it kinda makes sense). See: https://goaccess.io/man I could probably hack it and overload different HTTP status codes to mean different screen sizes or something, but I didn't consider device size to be important for me. GoAccess does break down the User…

If you’re using JavaScript you could make a request in the background with a bunch of HTTP headers added like X-Screen-Resolution and then have your web server log them.

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#93
post #77

Love what you are doing here. A few points: 1. I would rename the pixel.png to something like image.png. Never call your script anything like tracking, analytics, or pixel when you don't want to be blocked by ad blockers. We use hello.js and hello.gif. [1] > Log file parsing is an old-skool but effective way of measuring the traffic to your site. 2. By using a pixel image you can bypass caching. When using server log…

> Never call your script anything like tracking, analytics, or pixel when you don't want to be blocked by ad blockers. But this is a tracking script, no? If I were you I'd keep the name that way so that if people don't want to be tracked, they don't.

I agree with this, but thankfully these posts have let us know to block hello.gif and hello.js by default now.

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#94
post #51

For those of you hosting on your own server, this is a PSA that awstats is still working. It reads server logs and makes little graphs via a cron job. It's fun to have analytics going back to 2002 in the same format. https://awstats.sourceforge.io/

Yes, I've also been using awstats for many years. It definitely works for a small site, has a lot of useful features and occasional releases still keep up with new user agents, etc. that pop up over time. Each time I want to switch I fail to find a suitable replacement. That said, behind the curtain, awstats has plenty of problems and shows its age. Most of it is a single ~20 kline script with hundreds of global vari…

I read issue [2] and I think its reasonable to do this at the LogFormat level. awstats doesn't need to do everything, that is probably how it got to be 20,000 lines.

I always use awstats to generate static pages, and that's what any security conscientious operator should do.

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#95
post #77

Earlier quoted context omitted.

> Never call your script anything like tracking, analytics, or pixel when you don't want to be blocked by ad blockers. But this is a tracking script, no? If I were you I'd keep the name that way so that if people don't want to be tracked, they don't.

If your business is to track people, yes. If it's to gather statistics without tracking people (like page views), I think it perfectly fine to bypass ad blockers. We even have a dedicated feature for bypassing ad blockers [1] because we think page views are not privacy invasive. We drop IP addresses from every request so there is no personal data in our database or logs. If you really want to block you can enable the…

I completely agree. I don't think Do not Track was ever about knowing how many visitors you have or the browser they use. That's basic knowledge needed to improve the site. Tracking becomes an issue if it's shared across pages and where personal data is collected without consent to sell it to the highest bidder.

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#96
post #45
post #4

> Obviously with log parsing you don’t get as much information as a JavaScript-heavy, Google Analytics-style system. There’s no screen sizes, no time-on-page metrics, etc. But that’s okay for me! This also bypasses Ad blocker. In the case you have a large percentage of technical audience (who presumably would have Ad blocker installed) this log can be way more accurate than GA. However this still requires setting up…

>This also bypasses Ad blocker. Not for me. `/pixel.png?` is blocked by default in uBlock.

welcome.png, hello.png, etc. will work. As will any random combination of letters.

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#97
post #4

> Obviously with log parsing you don’t get as much information as a JavaScript-heavy, Google Analytics-style system. There’s no screen sizes, no time-on-page metrics, etc. But that’s okay for me! This also bypasses Ad blocker. In the case you have a large percentage of technical audience (who presumably would have Ad blocker installed) this log can be way more accurate than GA. However this still requires setting up…

> I would really love it if GitHub pages or Netlify can provide some simple server-side tracking. It doesn't match GA but in some cases that's all I need. Cloudflare does this for free, and you can run it on top of Netlify, Github/Gitlab pages, etc. https://www.cloudflare.com/analytics/

I don't think Cloudflare's info is very helpful, at least in the free/cheap plans. It can help to roughly identify where your visitors come from and how many visits are from bots but that's about it.

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#98

Love what you are doing here. A few points: 1. I would rename the pixel.png to something like image.png. Never call your script anything like tracking, analytics, or pixel when you don't want to be blocked by ad blockers. We use hello.js and hello.gif. [1] > Log file parsing is an old-skool but effective way of measuring the traffic to your site. 2. By using a pixel image you can bypass caching. When using server log…

You don’t track user’s flow on site? like conversion for ecommerce, bounce rate, time on page, etc.?

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#99

Love what you are doing here. A few points: 1. I would rename the pixel.png to something like image.png. Never call your script anything like tracking, analytics, or pixel when you don't want to be blocked by ad blockers. We use hello.js and hello.gif. [1] > Log file parsing is an old-skool but effective way of measuring the traffic to your site. 2. By using a pixel image you can bypass caching. When using server log…

You don’t track user’s flow on site? like conversion for ecommerce, bounce rate, time on page, etc.?

Not at the moment. We will implement tracking user flow with in a privacy minded way. I asked Hacker News a while ago if they would think it was privacy friendly [1]

To be clear about the other thread about bypassing ad blockers. We will not have this feature when tracking user flow. People should have the right to block events if they want. But for basic info as in page views we keep offering the ad blocker bypass feature.

[1] https://news.ycombinator.com/item?id=19136044

Re: Show HN: I replaced Google Analytics with simple log-based analytics

#100
post #77

Earlier quoted context omitted.

> Never call your script anything like tracking, analytics, or pixel when you don't want to be blocked by ad blockers. But this is a tracking script, no? If I were you I'd keep the name that way so that if people don't want to be tracked, they don't.

The author said it himself, he could have just put Cloudfront in front of Pages and parsed the access logs there. The referrer and user-agent, which are sent by the browser, are in the request headers. There would be no need for JS or an image if the website owner just changed their setup. How do you deal with this sort of tracking?

What do you mean? I think using CloudFront is not accurate enough if you use caching.
Post reply on HN