UPD: I found modern alternatives for GA. See my post here https://stereobooster.com/posts/useful-modern-tools-for-static-websites/
I want to start my personal blog and I need analytics there. I want to use Hugo (or another static site generator) and host it with Netlify (or now, or S3 + CloudFlare). This means that I need to use 3-rd party service to collect analytics, right? I do not plan to monetize blog (do not know how?), so I don't want to pay for analytics service. I guess cheapest would be to rent DigitalOcean server for 5$ month (e.g. 60$ a year). But Google analytics costs 0$. On the other hand, I concerned about the privacy of my visitors.
Demo is here. Source code is here.
Current solution
For now, I decided to use Google analytics with ganalytics.
I ask for consent before saving any data to the user device
<div class="cookie" hidden>
<p>
Can we store cookies on your device? See <a href='{{ .Site.BaseURL }}privacy/'>Privacy Policy</a> for details.<br>
<button type="button" class="cookie-yes">Yes</button> <button type="button" class="cookie-close">Close</button>
</p>
</div>
If I don't have consent I send anonymized request to Google analytics, but don't store any identifier on the device.
If I have consent I send a regular request with stored id.
There is a form with which the user can revoke consent and erase a locally stored identifier.
<form class="consent">
You can revoke consent and remove unique identifier ("cookies") at any time using the form below.
<noscript>This form needs JavaScript enabled in the browser in order to work</noscript>
<br><br>
<input type="radio" id="agree" name="consent" value="agree">
<label for="agree">I <b>allow</b> to store a unique identifier on my computer to track my visits to this site.</label>
<br><br>
<input type="radio" id="disagree" name="consent" value="disagree">
<label for="disagree">I <b> don't allow</b> to store unique identifier on my computer.</label>
</form>
This form is on the page with the privacy policy, which explains that the website uses Google analytics and when data sent.
Remarketing feature is turned off. Advertising Reporting Features are turned off. I don't want to share data with Google.
I simply want to know a number of views of my posts, top source of traffic (search, social, referral), maybe region - nothing fancy.
WDYT
What do you think about my solution? Is it fair privacy-wise? Do I miss something?
Top comments (13)
I haven't tried it myself but I am really interested in Matomo (used to be Piwik), they are free if you host it yourself.
I wrote about this in article - the cheapest hosting I can think of is DIgitalOcean (I guess AWS will be cheaper but much more pain as well)
So free = $60 year and I will need to maintain it myself (roll security patches etc)
There is github.com/usefathom/fathom as well.
You might be able to use Matomo on AWS free tier for a year?
Yes, itβs more work but itβs also a learning opportunity.
With free of charge saas like google analytics, it has to be worth it for the provider so you or your visitors are the product.
Yes I know. I wonder if strict privacy settings in GA would help to make it tolerable. It doesn't send cookies (so they don't know which user is that even if I logged into Gmail). I store (with permission) unique identifier in local storage (not in cookies). You can't really identify user outside of the website and no private information is stored. And you can erase it at any point. I can send anonymous IP flag.
So Iβve been running keen.io alongside google for a site I manage and I much prefer keen for drilling into the data. It has an auto collector script that works much like ga would except you own all the data and it has ways to disable it in the case that users want to opt out. It has a generous free tier and is very inexpensive after that. For a site with about 1k monthly uniques it ran about $1.50 a month on average.
As another plus itβs highly customizable so you can capture interesting stats and behaviors and embed cool dataviz graphs where you want.
Interesting. Price is nice. I wonder if they are GDPR compliant (They are in the US as far as I can see).
So here's my question. How do any analytics help you?
I mean, it can tell you how popular a page is and where your traffic is from sometimes, but outside of those two reasons, what is the purpose of using analytics?
If the thing you are looking for is just how popular your page is but it isn't driving any action, maybe consider removing them entirely.
About 2 years ago I had Google Analytics and I decided I'm done with Google and Facebook. So I moved to clicky. Then once I had that data, I realized, it was neat to see... but, it wasn't actionable.
There was literally nothing I gained from this information. It wasn't going to drive the content I write. So a few months ago I removed them entirely. Now the only "analytics" i have is from my algolia search, and those things are actionable. Searched terms and searched terms with no results. Now I have a list of pages to make/update.
I'd love to hear your feedback @stereobooster on this.
1.
This is what I basically need (from my post):
2.
Knowing that my posts are viewed keeps me motivated as an author. This is the main reason.
Others would be:
This maybe an option netlify.com/products/analytics/
Apologies if I missed this in your article, but why not just use Google Analytics directly? Why are you using Ganalytics?
Ganalytics is 312B
Nice. I'm not really an expert in hosting providers. I wonder if any of those have servers in EU
Thanks. You are very helpful. This remind me about blog.simpleanalytics.io/why-we-mov...