Skip to content

Commit

Permalink
Merge pull request mattvh#297 from wchliao/ga-code
Browse files Browse the repository at this point in the history
Update Google Analytics code
  • Loading branch information
sergiokopplin authored Jan 29, 2019
2 parents b2e554c + 6bb3188 commit 39e2ecd
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions _includes/analytics-google.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<!-- Google Analytics Tracking code -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.analytics-google }}']);
_gaq.push(['_trackPageview']);
(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);
})();
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics-google }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ site.analytics-google }}');
</script>

0 comments on commit 39e2ecd

Please sign in to comment.