Skip to content

Instantly share code, notes, and snippets.

@germs12
Last active December 21, 2015 23:19
Show Gist options
  • Select an option

  • Save germs12/6381719 to your computer and use it in GitHub Desktop.

Select an option

Save germs12/6381719 to your computer and use it in GitHub Desktop.
piwik installation
# http://piwik.org/docs/installation/
# http://piwik.org/docs/requirements/
$ sudo chown -R _www:_www /Library/WebServer/Documents/analytics/piwik
# TRACKING CODE #
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://localhost/analytics/piwik//";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="http://localhost/analytics/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Code -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment