Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Commit

Permalink
Simplify the Google Analytics snippet using async & defer
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 19, 2016
1 parent 4ca2139 commit 6e607c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
5 changes: 2 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ module.exports = function(grunt) {
"<%= dirs.src %>/assets/js/vendor/jquery.mousewheel.js",
"<%= dirs.src %>/assets/js/vendor/jquery.fancybox.js",
"<%= dirs.src %>/assets/js/img-defer.js",
"<%= dirs.src %>/assets/js/no-js-class.js",
"<%= dirs.src %>/assets/js/google-analytics.js"],
"<%= dirs.src %>/assets/js/no-js-class.js"],
dest: "<%= dirs.dest %>/assets/js/pack.js"
}
},
Expand Down Expand Up @@ -236,7 +235,7 @@ module.exports = function(grunt) {
jshintrc: ".jshintrc"
},
files: {
src: ["Gruntfile.js", "<%= dirs.src %>/assets/js/*.js", "!<%= dirs.src %>/assets/js/google-analytics.js"]
src: ["Gruntfile.js", "<%= dirs.src %>/assets/js/*.js"]
}
},

Expand Down
8 changes: 8 additions & 0 deletions source/_includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,13 @@ <h4><span class="fa fa-exclamation-circle" aria-hidden="true"></span> Warning!</
{% if page.useFancybox %}
{% include fancybox.html %}
{% endif %}

<script>
window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
ga('create', 'UA-9335012-2', 'mpc-hc.org');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview')
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>
</body>
</html>
10 changes: 0 additions & 10 deletions source/assets/js/google-analytics.js

This file was deleted.

0 comments on commit 6e607c4

Please sign in to comment.