This page demonstrates how a complete user-interaction across multiple domains can be tracked without using HTTP cookies, instead using "Local storage", introduced with HTML5. Local storage is a client-side implementation to save individual client-specific information within the browser. The web server has no access to the local storage data. It need to use JavaScript run locally to access such data. Here, we demonstrate how to use local storage for cross-domain tracking. We generate a unique ID for each user and to save it within the local storage, instead of saving in a HTTP-cookie, which is the usual practice. Local storage data has no specific validity, therefore remains till it is deleted.
Every page that needs to be tracked, has been embedded with a "tracking pixel", which is an iframe with the source property set to the tracking URL "//connex.net.nz/alternate/TrackETag". The web page that loads Within the iframe has a JavaScipt file "lsIframe.js" looks for the "VisitorID" stored in local storage, and if found uses that to update the click pixels URL parameter "V", which stands for the unique visitor ID. If no VisitorID is found within local stoarge, the JavaScript calls the "//connex.net.nz/alternate/Tracklocal" to obtain a unique id.
As the "Local storage" is unique to the calling URL, it needs to be called from a URL that is common to every tracked domain. Hence it is called from a JavaScript within the embedded iframe, whose source is within the "connex.net.nz" domain. This makes CORS (Cross-domain resource sharing) headers unnecessary, too.
In this experiment, the iframe has been intentionally kept visible, so that the UID in Local Storage for the page within the iframe, which is homed on connex.net.nz tracking domain, is visible. In normal usage, this iframe will be made invisible by setting the height/width to zero. This unique id stored in connex.net.nz is used as tracking ID. Compare it with the uniqe ID assigned on the parent page, when the same JavaScript is run within the local domain, which is displayed above the banner advertisement.
Open the tracking results page and note the last click and conversions result entry IDs, which appear as first result in each table. The records are sorted in descending order. Return to the test page, and click on the banner advertisement. Notice, the redirection to the advertiser's e-commerce page. simulate a purchase action by entering a total price and press "Pay". A payment confirmation page will be displayed. Go back to the tracking results page and you should see a new click entry and a conversion entry.Note the date/time is UTC timezone. For extra information, press "F12" to open the developer tools in your browser, before you start the experiment, to observe the headers and returend values for each resource request.