Created
August 8, 2012 16:17
-
-
Save nfreear/3296311 to your computer and use it in GitHub Desktop.
Piwik Javascript tracking sample page
This file contains hidden or 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
| <!doctype html> <title>*Piwik - Javascript track</title> | |
| <h1>Piwik</h1> | |
| <!-- Piwik --> | |
| <script> | |
| var pkBaseURL = | |
| (("https:" == document.location.protocol) ? "https://localhost:8888/piwik/" | |
| : "http://localhost:8888/piwik/"); | |
| document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); | |
| </script> | |
| <script> | |
| try { | |
| var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1); | |
| //piwikTracker.setCustomVariable(1, 'Category', 'Sports', 'page'); | |
| piwikTracker.setCustomVariable(1, 'License', 'cc:by-nc-sa/2.0/uk', 'visit'); | |
| piwikTracker.trackPageView(); | |
| piwikTracker.enableLinkTracking(); | |
| } catch( err ) {} | |
| </script> | |
| <noscript><p><img src="http://localhost:8888/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript> | |
| <!-- End Piwik Tracking Code --> | |
| <pre> | |
| N.D.Freear, 7 August 2012. | |
| &_cvar=%7B%221%22%3A%5B%22License%22%2C%22cc%3Aby-nc-sa%2F2.0%2Fuk%22%5D%7D | |
| &_cvar={"1":["License","cc:by-nc-sa/2.0/uk"]} | |
| </pre> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment