Skip to content

Commit

Permalink
Adds Piwik Analytics Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
rsertelon committed Sep 11, 2012
1 parent 9c00269 commit a6f699c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ JB :
site_id :
mixpanel :
token : '_MIXPANEL_TOKEN_'
piwik :
baseURL : 'myserver.tld/piwik' # Piwik installation address (without protocol)
idsite : '1' # the id of the site on Piwik

# Settings for sharing helper.
# Sharing is for things like tweet, plusone, like, reddit buttons etc.
Expand Down
2 changes: 2 additions & 0 deletions _includes/JB/analytics
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
{% include JB/analytics-providers/getclicky %}
{% when "mixpanel" %}
{% include JB/analytics-providers/mixpanel %}
{% when "piwik" %}
{% include JB/analytics-providers/piwik %}
{% when "custom" %}
{% include custom/analytics %}
{% endcase %}
Expand Down
10 changes: 10 additions & 0 deletions _includes/JB/analytics-providers/piwik
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{{ site.JB.analytics.piwik.baseURL }}/" : "http://{{ site.JB.analytics.piwik.baseURL }}/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {{ site.JB.analytics.piwik.idsite }});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://{{ site.JB.analytics.piwik.baseURL }}/piwik.php?idsite={{ site.JB.analytics.piwik.idsite }}" style="border:0" alt="" /></p></noscript>

0 comments on commit a6f699c

Please sign in to comment.