Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Google Analytics

  • Loading branch information...
commit 6713dd386907953ab99ece6718ef737f3c85c535 1 parent edd36df
@marksim authored
Showing with 11 additions and 11 deletions.
  1. +2 −1  _config.yml
  2. +9 −10 source/_includes/google_analytics.html
View
3  _config.yml
@@ -93,7 +93,8 @@ disqus_short_name: autoficiency
disqus_show_comment_count: true
# Google Analytics
-google_analytics_tracking_id:
+google_analytics_tracking_id: UA-2769308-3
+google_analytics_domain: quarternotecoda.com
# Facebook Like
facebook_like: false
View
19 source/_includes/google_analytics.html
@@ -1,13 +1,12 @@
{% if site.google_analytics_tracking_id %}
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '{{ site.google_analytics_tracking_id }}']);
- _gaq.push(['_trackPageview']);
+<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');
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
+ ga('create', '{{ site.google_analytics_tracking_id }}', '{{ site.google_analytics_domain }}');
+ ga('send', 'pageview');
+
+</script>
{% endif %}
Please sign in to comment.
Something went wrong with that request. Please try again.