Skip to content

Commit d998732

Browse files
committed
updates analytics
1 parent a4f9da0 commit d998732

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

_includes/analytics.html

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
{% if site.google_analytics %}
2-
<!-- Google Analytics -->
3-
<script>
4-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
5-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
6-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
7-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
1+
<!-- Global site tag (gtag.js) - Google Analytics -->
2+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-128473974-1"></script>
3+
<script>
4+
window.dataLayer = window.dataLayer || [];
5+
function gtag(){dataLayer.push(arguments);}
6+
gtag('js', new Date());
7+
8+
gtag('config', 'UA-128473974-1');
9+
</script>
810

9-
ga('create', '{{ site.google_analytics }}', 'auto');
10-
ga('send', 'pageview', {
11-
'page': '{{ site.baseurl }}{{ page.url }}',
12-
'title': '{{ page.title | replace: "'", "\\'" }}'
13-
});
14-
</script>
15-
<!-- End Google Analytics -->
16-
{% endif %}

_layouts/default.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</title>
4+
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.name }} - {{ site.description }}</title>
5+
6+
{% include analytics.html %}
57

68
{% include meta.html %}
79

@@ -46,6 +48,5 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
4648
</div>
4749
</div>
4850

49-
{% include analytics.html %}
5051
</body>
5152
</html>

0 commit comments

Comments
 (0)