Simple Bloggy Tracking
11 Oct 2015 · 📖 in 2 minutes Someone is always watching you...Here in the UK we are used to being watched, constantly, 24/7. It's an odd thing to rectify because given the option I imagine most would opt out. It's probably that kind of attitude that means websites in the EU have to display the cookie usage messages.
Tracking on the web is nothing like CCTV but it's something that we've come to accept. Realistically if you're doing something interesting on the web from eCommerce to streaming there'll be a cookie involved somewhere. They are also abused. Tracking cookies follow you around the internet and this information is used for targeted advertising.
TechRam won't do that!
If I ever monitise techram it'll be donation based and i'll maybe post my bitcoin info on the about page.
So what is this post about then?
Bloggy Tracking and Analytics
First let me explain, bloggy is the codename for this blog. There's a long running nomenclature that I follow, deviously simple, add a 'y' to the end of a word.
I am interested in what areas of the blog people are visiting, while I can do some of that with the NGINX logs, (oh, I've moved to NGINX now, can you tell?) I am more interested in putting together a simple client-server app in Node.JS. Node interests me as it allows me to write servers with JavaScript, and it seems you can do just about anything in Node.
Using the powerful V8 JavaScript engine and an event-driven achitecture it's perfectly positioned to handle the paultry task of serving tracking data. (Then again so is PHP / Java / Phython or any other established web language but right now i'm writing JavaScript so why not!)
Below is a realtime sample output of the data:
As you can see I'm keeping an eye on all sorts of goings on, IP address, session length and more importantly location. All of this data is available to me in the logs. I could write a parser and piece together sessions of unique IPs, but where's the fun in that?
Ideas for the future
I've had a few ideas of what I can do in the future to build on these baby steps:
- Inactivity
- How far you scrolled
- External Links clicked
- Page load metrics (if possible)
Watch this space!
First appeared on Trusty Interior, last update 14 Nov 2023