Permalink
Browse files

Adding Mixpanel as analytics provider

  • Loading branch information...
1 parent 878e06c commit af8839037cb42f6fddf75bda7e89e4adb59d3891 @koomar koomar committed Feb 29, 2012
Showing with 17 additions and 1 deletion.
  1. +4 −1 _config.yml
  2. +2 −0 _includes/JB/analytics
  3. +11 −0 _includes/JB/analytics-providers/mixpanel
View
@@ -97,11 +97,14 @@ JB :
# Set 'provider' to false to turn analytics off globally.
#
analytics :
- provider : google
+ provider : mixpanel
google :
tracking_id : 'UA-123-12'
getclicky :
site_id :
+ mixpanel :
+ token : '_MIXPANEL_TOKEN_'
+
# Settings for sharing helper.
# Sharing is for things like tweet, plusone, like, reddit buttons etc.
View
@@ -5,6 +5,8 @@
{% include JB/analytics-providers/google %}
{% when "getclicky" %}
{% include JB/analytics-providers/getclicky %}
+{% when "mixpanel" %}
+ {% include JB/analytics-providers/mixpanel %}
{% when "custom" %}
{% include custom/analytics %}
{% endcase %}
@@ -0,0 +1,11 @@
+<script type="text/javascript">
+ var mpq = [];
+ mpq.push(["init", "{{ site.JB.analytics.mixpanel.token}}"]);
+ (function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";
+ b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+
+ "//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];
+ a.parentNode.insertBefore(b,a);e=function(f){return function(){mpq.push(
+ [f].concat(Array.prototype.slice.call(arguments,0)))}};d=["init","track","track_links",
+ "track_forms","register","register_once","identify","name_tag","set_config"];for(c=0;c<
+ d.length;c++){mpq[d[c]]=e(d[c])}})();
+</script>

0 comments on commit af88390

Please sign in to comment.