Skip to content

Commit

Permalink
Fixes PR plusjade#158. Add baidu analytics provider. I didn't create …
Browse files Browse the repository at this point in the history
…an account to test, but this is isolated code and the risk to break existing analytics modules is low.
  • Loading branch information
groundh0g committed Oct 17, 2015
1 parent b88b328 commit 386155e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ JB :
site_id :
mixpanel :
token : '_MIXPANEL_TOKEN_'
baidu :
token : '_BAIDU_TOKEN_'
piwik :
baseURL : 'myserver.tld/piwik' # Piwik installation address (without protocol)
idsite : '1' # the id of the site on Piwik
Expand Down
2 changes: 2 additions & 0 deletions _includes/JB/analytics
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
{% include JB/analytics-providers/google-universal %}
{% when "getclicky" %}
{% include JB/analytics-providers/getclicky %}
{% when "baidu" %}
{% include JB/analytics-providers/baidu %}
{% when "mixpanel" %}
{% include JB/analytics-providers/mixpanel %}
{% when "piwik" %}
Expand Down
4 changes: 4 additions & 0 deletions _includes/JB/analytics-providers/baidu
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%{{ site.JB.analytics.baidu.token }}' type='text/javascript'%3E%3C/script%3E"));
</script>

0 comments on commit 386155e

Please sign in to comment.