Things like session duration and bounce rate, broken down by page, can tell what content people enjoy and what contents needs some work.
All those things can be gathered from the initial request if you can set a cookie on the user's machine using a cookie header. If you're Firebase then you'd need a request for firebase-analytics.js to set the cookie, but the file itself could be empty.
Also useful to know what fraction of your users are recurring versus new users to tell whether people actually return to your site or if they just check it out once.
Once the cookie is set you can get all this from the server side logs.
Lastly, the refer stats can help you figure out what other sites and communities are interested in your project so that you can further engage with them.
Referers, if they're available at all, come in an HTTP header so once again server side logs would give you this data.
There is no reason to serve any JS for logging unless you want browser fingerprinting data like the user's window size. If your analytics script is more than 0kb then you're tracking people.
This is so incredibly true. It's astounding how an entire generation can't be bothered to look at their own server logs and think they need to pipe it off to a third-party to let them present graphs to you.
To be fair, you can't tell how long someone spent looking at page using just cookies. You can't distinguish between me (a) loading your page then immediately closing it, (b) loading it, reading it for ten seconds, then closing it, (c) loading it, reading it for ten minutes, then closing it, and (d) loading it, leaving the tab alone for ten minutes, reading it for ten minutes, then closing it.
But it doesn't take 50 kB of JS to be able to do that!
You can't tell if I load a page and then walk away and spend 5 minutes making a cup of tea, and then come back and close the tab without looking at it either. Even with JS. Assuming that having a tab active and focused means a person is engaged with the page is false.
Also, believing a page is better because I spend 10 minutes on it rather than 5 is nonsensical. Am I reading everything (good) or am I hunting around for some piece content and not finding it (bad)?
Time on page is a stupid metric that doesn't measure anything useful.
And that's when things get seriously invasive and people start saying "Why are you using a 26kb tracking script?"
If you collect information about how often a user is moving their mouse and scrolling the page in order to tell how long someone has been on a page then you've moved from collecting what's useful to collecting everything you can just in case it's useful. That decision comes at the cost of invading everyone's privacy, and that needs to stop.
All those things can be gathered from the initial request if you can set a cookie on the user's machine using a cookie header. If you're Firebase then you'd need a request for firebase-analytics.js to set the cookie, but the file itself could be empty.
Also useful to know what fraction of your users are recurring versus new users to tell whether people actually return to your site or if they just check it out once.
Once the cookie is set you can get all this from the server side logs.
Lastly, the refer stats can help you figure out what other sites and communities are interested in your project so that you can further engage with them.
Referers, if they're available at all, come in an HTTP header so once again server side logs would give you this data.
There is no reason to serve any JS for logging unless you want browser fingerprinting data like the user's window size. If your analytics script is more than 0kb then you're tracking people.