I Had Removed Google Analytics and Google Services from My Website Why I Did It?
1–10 of 14 posts
Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#2Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#3I have a Hugo blog running on Netlify. All I need is to know if someone has visited it or not. I'm using Google analytics currently but would gladly use something much simpler. Any alternatives?
Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#4I have a Hugo blog running on Netlify. All I need is to know if someone has visited it or not. I'm using Google analytics currently but would gladly use something much simpler. Any alternatives?
Plausible.io, or just write something yourself
I usually open source my code, I just haven't gotten around to it for this one in particular. Might be worth doing if people are interested.
Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#5Earlier quoted context omitted.
Plausible.io, or just write something yourself
Writing it myself is what I did for my blog. The only thing I capture is the page that was visited, when it was visited, and the domain of the referrer (to see what the source is). The tracker is meant to be used for blogs where I don't control the server, such as Github Pages, so there's a single AJAX call to my self-hosted server. I usually open source my code, I just haven't gotten around to it for this one in par…
> The only thing I capture is the page that was visited, when it was visited, and the domain of the referrer (to see what the source is). The tracker is meant to be used for blogs where I don't control the server, such as Github Pages, so there's a single AJAX call to my self-hosted server.
To be honest, I'm not entirely sure how I'd solve this without the 'single AJAX call' but I guess it makes sense to start there!
Curious how you implemented it - again, I'm not a rocket surgeon and this is just like a 3 second analysis of the problem space, but it's always neat to check out other people's implementations for common, shared problems
Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#6I have a Hugo blog running on Netlify. All I need is to know if someone has visited it or not. I'm using Google analytics currently but would gladly use something much simpler. Any alternatives?
Plausible.io, or just write something yourself
Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#7Earlier quoted context omitted.
Plausible.io, or just write something yourself
Having added Plausible to my site recently, one killer feature in my opinion is the ability to rewrite the analytics script to be served from your own domain. What this means in effect is that it won't get picked up in traditional ad blockers so the accuracy is much closer to that of server log parsing. Additionally, you can surface your analytics publically which is cool.
Public analytics seems interesting - have you been able to do anything particularly interesting by leveraging this capability?
Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#8I have a Hugo blog running on Netlify. All I need is to know if someone has visited it or not. I'm using Google analytics currently but would gladly use something much simpler. Any alternatives?
Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#9Re: I Had Removed Google Analytics and Google Services from My Website Why I Did It?
#10Earlier quoted context omitted.
Writing it myself is what I did for my blog. The only thing I capture is the page that was visited, when it was visited, and the domain of the referrer (to see what the source is). The tracker is meant to be used for blogs where I don't control the server, such as Github Pages, so there's a single AJAX call to my self-hosted server. I usually open source my code, I just haven't gotten around to it for this one in par…
Yeah sure! Please do open source it if you choose to, I've been thinking about something similar but it's just not pressing vs. all the other stuff I'm working on. I literally haven't given it much thought beyond "ok intercept the request from a visitor, do some analytics on the IP address, and then log visits of logged in users/new visitors" > The only thing I capture is the page that was visited, when it was visite…
You're right: if you don't control the server, you basically can't intercept any requests without this extra AJAX call, or some similar mechanism like a tracking image served from your own server. Essentially, you need to make a request to your own server at some point!
The architecture is pretty simple:
1. Insert the AJAX request into each page, sending the page URL and the referrer in the payload. Because I found some weirdness with tools like Pocket serving my pages from some cached location, I use my static site generator (Jekyll) to embed the page URL into each page, instead of pulling it from the client side.
2. I support multi-tenancy on a single tracking server by using multiple domain names. Based on the incoming domain name, I have nginx attach an additional header to the request that says which site is being tracked. This way, I can have my personal blog and my newsletter website both tracked by the same tracking server instance.
3. Then, it's just a matter of storing the data (page URL, time of visit, referrer domain, which site) into a SQLite database.
4. And of course, I have a small web UI to view the data.
Note that I don't do anything with the IP address of the visitor. That's personal data that I don't track.