Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denying cookies crashes the script #44

Open
jehna opened this issue Sep 29, 2017 · 5 comments
Open

Denying cookies crashes the script #44

jehna opened this issue Sep 29, 2017 · 5 comments
Labels

Comments

@jehna
Copy link
Owner

jehna commented Sep 29, 2017

If your browser has cookies disabled, using localStorage throws an error that crashes ga-lite.

ga-lite should be able to work even without localstorage.

@jehna jehna added the bug label Sep 29, 2017
@jehna
Copy link
Owner Author

jehna commented Feb 7, 2018

According to MDN:

Safari Mobile's Private Browsing mode also prevents writing to localStorage entirely.
https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage#Browser_compatibility

So we should be able to skip localStorage and degrade backwards without crashing.

@mcrawshaw
Copy link

I am having this issue with an anonymous browser (Windows 7 / Chrome 72.0.3626). It's rare but just occurred on our production site.

@jehna
Copy link
Owner Author

jehna commented Mar 20, 2019

This probably can be quick fixed if we add a try-catch to get-user-id.js and fall back to something that does not require a persistence (like a normal variable).

@jehna
Copy link
Owner Author

jehna commented Mar 20, 2019

Though denying cookies is a strong indicator that the user does not want to be tracked; I'm thinking if we should disable the ga-lite tracking then altogether?

@mcrawshaw
Copy link

I have no issue with doing that... It seems like a rare case anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants