Skip to content

Commit 60384b2

Browse files
committed
Move analytics code to footer
1 parent 91e0895 commit 60384b2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

_includes/footer.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@
44
<span class="backtotop">back to top</span>
55
</div>
66
</footer>
7+
<script>
8+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
9+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
10+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
11+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
12+
ga('create', '{{ site.analytics_id }}', 'auto');
13+
ga('send', 'pageview');
14+
</script>

_layouts/index.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,5 @@
2323
</section>
2424
{% include footer.html %}
2525
<script src="{{ site.baseurl | replace: '//', '/' }}/js/build/global.min.js"></script>
26-
<script>
27-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
28-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
29-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
30-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
31-
ga('create', '{{ site.analytics_id }}', 'auto');
32-
ga('send', 'pageview');
33-
</script>
3426
</body>
3527
</html>

0 commit comments

Comments
 (0)