Created
September 3, 2013 09:00
-
-
Save eloycoto/6421379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tracker = Piwik.getTracker( '{{PIWIK_URL}}', '1' ); | |
var info = tracker.getVisitorInfo(); | |
var optin = false; | |
var alreadyTracking = info[0] != '1' || info[3] > 0; | |
if (!alreadytracking) { | |
optin = confirm( 'Opt-in to use cookies?' ); | |
} | |
if (optin || alreadyTracking) { | |
tracker.enableLinkTracking(); | |
tracker.trackPageView(); | |
// etc | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment