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

Use Web storage to persist data when cookies are disabled #4015

Open
anonymous-matomo-user opened this issue Jun 20, 2013 · 4 comments
Open
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.

Comments

@anonymous-matomo-user
Copy link

This is a proposal regarding http://piwik.org/faq/general/#faq_43

There are cases where cookies are not supported either because the browser (user) has disabled them, or because the tracking code is running under the file:// protocol and not the http:// protocol. The latter case applies to following scenarios (among others):

  1. The tracking code (javascript) is in a page and the page is loaded statically (file://) inside a WebView in a native app (Android/iOS).
  2. The tracking page is loaded inside a native WebView which has disabled the cookies.

In order to be able to produce unique visitor ids on the client and persist them on the client side, the HTML5 localStorage and sessionStorage could be used a a fallback mechanism.

The proposed flow inside piwik.js could be like this:

#!javascript
if (cookiesSupported()) {
   // use original/current piwik.js code
} else if (html5storageSupported() {
   // fall back to this and store the visitor id and the custom variables
   // using HTML5 localStorage and sessionStorage.
} else {
   // use the rule of thumb to match the visitor on the server
   // using the visitor settings.
}

Keywords: cookies HTML5 localstorage sessionstorage

@robocoder
Copy link
Contributor

I'm not against this, but it's more complicated since we support opt-out. Side note: the evercookie proposal in #1725 was closed.

@anonymous-matomo-user
Copy link
Author

Using HTML5 localStorage does not break the opt-out mechanism. Instead of removing a cookie (or creating a no-track cookie) it can be that a localStorage variable that is created instead. Evercookie is by far a different approach. It creates a zombie cookie and it is not recommended for Piwik, I agree with you. All I'm suggesting is to have an alternative to store something on the client.

@mattab
Copy link
Member

mattab commented Jun 23, 2013

Thanks for the proposal. I like the idea!

How much code would this represent to be added to piwik.js? Would you submit such improvement?

@hpvd
Copy link

hpvd commented Apr 6, 2014

hmm should we always store piwik identification directly on both places?
To make it redundant?
Maybe not by default but having to the possibility to activate it?

@anonymous-matomo-user anonymous-matomo-user added this to the Future releases milestone Jul 8, 2014
@mattab mattab modified the milestones: Long term, Mid term Dec 23, 2015
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

4 participants