I can't remember the last time I was truly interested in insight and had an app on a single server, non-loadbalanced and so on. A distributed system is a pain in terms of log scraping if you don't have the adequate tooling (ELK, Graphite,...). Some JS-include may be a less costly solution.
It's hard to analyze more than page views using only webserver logs. I might be interested in some specific user behavior (e.g. how much times he clicked this button, etc.). That's why we have to put a js script.
Let's have a simple case. How are you going to analyze how much times a user clicked a button? I don't want to reload the page on each click (to send a GET request) and AFAIK there's no way to do that without JS. And if I can use JS for that case, why would I want to do that if I can simply myTracker.send({'action': 'my-button.click', ...})?
If that button does anything relevant, it's going to leave evidences on your server anyway. Theoretically, we don't really need JS to reload a subset of a page on a button click: HTML and CSS are enough, with proper uses of IFRAME.
However you are right that, if you are using JS anyway, a bit more bloat doesn't change much.
The point is that we shouldn't use JS just because it exists, but only if there's something we cannot really do otherwise. Forcing our users to execute code we didn't write and we don't feel responsible for is rude: we are wasting their resources (and potentially compromising their security) just to save some money.
I understand very well what Google Analytics does.
You CAN get much of the same insight from properly configured server logs on a properly designed website.
GA build good reports on top of data collected through JS, but you could build similar reports by yourself and people used to do that sort of analytics before it.
The problem is that website owners sell their visitors' data for such reporting.
So it's way cheaper to them than a good team of developers and data analysts.
Analytics are useful for generated static sites (jekyll, hugo, ...) hosted on gitlab or github.
Otherwise, I agree that embedding a JS that sends requests just to compute stats is kinda weird.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nobody is able to analyze webserver's logs anymore?
Why you have to put a JS script in your pages?
I can't remember the last time I was truly interested in insight and had an app on a single server, non-loadbalanced and so on. A distributed system is a pain in terms of log scraping if you don't have the adequate tooling (ELK, Graphite,...). Some JS-include may be a less costly solution.
It obviously depends on how you design the web site / web application.
JS-includes are cheaper for developers, but expensive (in term of both security and computing resources) for users.
It's hard to analyze more than page views using only webserver logs. I might be interested in some specific user behavior (e.g. how much times he clicked this button, etc.). That's why we have to put a js script.
You don't need js for that, a querystring is enough.
Not really. What about SPAs?
Let's have a simple case. How are you going to analyze how much times a user clicked a button? I don't want to reload the page on each click (to send a GET request) and AFAIK there's no way to do that without JS. And if I can use JS for that case, why would I want to do that if I can simply
myTracker.send({'action': 'my-button.click', ...})
?It's quite obvious that if you are using JS anyway, a little more bloat doesn't change much.
However there is often no reason to use JS and plenty of reasons to NOT execute third party's code on your users' machines if you care about your users' privacy and security.
If that button does anything relevant, it's going to leave evidences on your server anyway. Theoretically, we don't really need JS to reload a subset of a page on a button click: HTML and CSS are enough, with proper uses of IFRAME.
However you are right that, if you are using JS anyway, a bit more bloat doesn't change much.
The point is that we shouldn't use JS just because it exists, but only if there's something we cannot really do otherwise. Forcing our users to execute code we didn't write and we don't feel responsible for is rude: we are wasting their resources (and potentially compromising their security) just to save some money.
So what about putting some JS for our browsers to execute? This is not the 90's web.
True.
After the crash of 2000 we have slowly turned a dream to a nightmare.
And after Cambridge Analytica, after Snowden and after event-stream, I wonder how we can still argue that it's all fine.
We are abusing users' ignorance.
I don't think you understand what Google Analytics is.
Web server logs wont help me understand the age and gender of my audience. GA does.
Google analytics allows me to easily export reports and view metrics graphically.
Teams within my business use the conversation tracking tools to measure where different parts of our site drive the most sales.
GA is used for more than simply tracking hits on a page.
ROTFL!
I understand very well what Google Analytics does.
You CAN get much of the same insight from properly configured server logs on a properly designed website.
GA build good reports on top of data collected through JS, but you could build similar reports by yourself and people used to do that sort of analytics before it.
The problem is that website owners sell their visitors' data for such reporting.
So it's way cheaper to them than a good team of developers and data analysts.
Everybody is fine... except
milking cowsusers.Analytics are useful for generated static sites (jekyll, hugo, ...) hosted on gitlab or github.
Otherwise, I agree that embedding a JS that sends requests just to compute stats is kinda weird.