|
74 | 74 | <link href="{{ site.baseurl }}/assets/css/main.css" rel="stylesheet"> |
75 | 75 |
|
76 | 76 | <script src="{{ site.baseurl }}/assets/js/jquery.min.js"></script> |
| 77 | + |
| 78 | + {% if site.google_analytics %} |
| 79 | + <!-- Global site tag (gtag.js) - Google Analytics --> |
| 80 | + <script async src="https://www.googletagmanager.com/gtag/js?id={{site.google_analytics}}"></script> |
| 81 | + <script> |
| 82 | + window.dataLayer = window.dataLayer || []; |
| 83 | + function gtag(){dataLayer.push(arguments);} |
| 84 | + gtag('js', new Date()); |
| 85 | + |
| 86 | + gtag('config', '{{site.google_analytics}}'); |
| 87 | + </script> |
| 88 | + {% endif %} |
77 | 89 |
|
78 | 90 | </head> |
79 | 91 |
|
80 | | -{% if site.google_analytics %} |
81 | | -<script> |
82 | | - (function (i, s, o, g, r, a, m) { |
83 | | - i['GoogleAnalyticsObject'] = r; |
84 | | - i[r] = i[r] || function () { |
85 | | - (i[r].q = i[r].q || []).push(arguments) |
86 | | - }, i[r].l = 1 * new Date(); |
87 | | - a = s.createElement(o), |
88 | | - m = s.getElementsByTagName(o)[0]; |
89 | | - a.async = 1; |
90 | | - a.src = g; |
91 | | - m.parentNode.insertBefore(a, m) |
92 | | - })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); |
93 | | - |
94 | | - ga('create', '{{site.google_analytics}}', 'auto'); |
95 | | - ga('send', 'pageview'); |
96 | | -</script> |
97 | | -{% endif %} |
98 | | - |
99 | 92 | {% capture layout %}{% if page.layout %}layout-{{ page.layout }}{% endif %}{% endcapture %} |
100 | 93 |
|
101 | 94 | <body class="{{ layout }}"> |
|
0 commit comments