@anonymous-piwik-user opened this Issue on June 20th 2013

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:

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 commented on June 22nd 2013 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-piwik-user commented on June 22nd 2013

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 commented on June 23rd 2013 Member

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 commented on April 6th 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?

Powered by GitHub Issue Mirror