5 ms·
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 ex
by kmfrk 6y ago
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/analyticsjs/cookies-user-id https://developers.google.com/analytics/devguides/collection...
- nerdponx 6y agoSeems to me like LocalStorage in this case is just a way to get around people deleting/blocking cookies. What would be the legitimate use?
- dgb23 6y ago> 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.
- itsthisjustin 6y agoYeah 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
- XCSme 6y agoSee 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.
- rafBM 6y agolocalStorage is no different than cookies from the perspective of privacy laws. https://softwareengineering.stackexchange.com/questions/290566/is-localstorage-under-the-cookie-law https://softwareengineering.stackexchange.com/questions/2905...
- XCSme 6y agoThe 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.