News for hackers. Stuff that matters.
Re:We ditched Google Analytics by kmfrk on Monday June 01, 2020 @10:24AM (#23378765)
How private is using localStorage for ID persistence instead of cookies for Google Analytics - and in general? It's what I'm using, but obviously it takes an expert to figure out just how much of an improvement it is.

Apparently Service Workers can also be used.

https://developers.google.com/analytics/devguides/collection...

Re:We ditched Google Analytics by rafBM on Monday June 01, 2020 @10:30AM (#23378831)
localStorage is no different than cookies from the perspective of privacy laws. https://softwareengineering.stackexchange.com/questions/2905...
Re:We ditched Google Analytics by XCSme on Monday June 01, 2020 @01:16PM (#23380977)
The biggest advantage of localStorage is that it is, as its name implies, "local" to the site you are visiting. Cookies can be shared accross domains and sites you visit, but localStorage can not. If one on domain you store `localStorage.ID = 5`, you can not read that from another domain, as `localStorage.ID` will be undefined in a different domain context.
Re:We ditched Google Analytics by nerdponx on Monday June 01, 2020 @10:25AM (#23378774)
Seems to me like LocalStorage in this case is just a way to get around people deleting/blocking cookies. What would be the legitimate use?
Re:We ditched Google Analytics by dgb23 on Monday June 01, 2020 @10:42AM (#23378959)
> What would be the legitimate use?

Caching/storing GUI state and user configuration.

You (the server) doesn't need to know about LocalStorage contents. You can read and write from it via JS without ever sending that data somewhere. It actually improves privacy if done this way, because then the user owns the data and you just act upon it.

Unfortunately Apple thinks otherwise, they clear LocalStorage in Safari after a while by default.

Re:We ditched Google Analytics by itsthisjustin on Monday June 01, 2020 @10:54AM (#23379106)
Yeah we use this on our Chrome Extension Next Up to avoid sending data to our server. Keeps everything cached locally and lot less data in transit
Re:We ditched Google Analytics by XCSme on Monday June 01, 2020 @01:17PM (#23380996)
See my comment above, localStorage can not be shared between domains as cookies can. So it's a lot better for privacy. With localStorage you can only track multiple visits of a user on the same site, not across sites.