Skip to content

Commit

Permalink
Universal Analytics Provider
Browse files Browse the repository at this point in the history
Getting tracking ID from:

site.JB.analytics.googleUA.tracking_id

Also Set conditional on property name to set to auto if missing
  • Loading branch information
cprobert committed Sep 8, 2014
1 parent c35069d commit bfeba20
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _includes/JB/analytics-providers/google-universal
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', {{ site.JB.analytics.googleUA.tracking_id }}', {% if site.JB.analytics.googleUA.property_name %}{{ site.JB.analytics.googleUA.property_name }}{% else %}'auto'{% endif %});
ga('send', 'pageview');
</script>

0 comments on commit bfeba20

Please sign in to comment.