Skip to content

Commit 2c98321

Browse files
committed
Merge pull request #106 from BluePyth/piwik_provider
Adds Piwik Analytics Provider
2 parents 8e43db2 + a6f699c commit 2c98321

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ JB :
106106
site_id :
107107
mixpanel :
108108
token : '_MIXPANEL_TOKEN_'
109+
piwik :
110+
baseURL : 'myserver.tld/piwik' # Piwik installation address (without protocol)
111+
idsite : '1' # the id of the site on Piwik
109112

110113
# Settings for sharing helper.
111114
# Sharing is for things like tweet, plusone, like, reddit buttons etc.

_includes/JB/analytics

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
{% include JB/analytics-providers/getclicky %}
88
{% when "mixpanel" %}
99
{% include JB/analytics-providers/mixpanel %}
10+
{% when "piwik" %}
11+
{% include JB/analytics-providers/piwik %}
1012
{% when "custom" %}
1113
{% include custom/analytics %}
1214
{% endcase %}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script type="text/javascript">
2+
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{{ site.JB.analytics.piwik.baseURL }}/" : "http://{{ site.JB.analytics.piwik.baseURL }}/");
3+
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
4+
</script><script type="text/javascript">
5+
try {
6+
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {{ site.JB.analytics.piwik.idsite }});
7+
piwikTracker.trackPageView();
8+
piwikTracker.enableLinkTracking();
9+
} catch( err ) {}
10+
</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 commit comments

Comments
 (0)