diff options
author | kucw <pk74323jacky@gmail.com> | 2020-11-13 12:38:22 +0300 |
---|---|---|
committer | kucw <pk74323jacky@gmail.com> | 2020-11-13 12:38:22 +0300 |
commit | deb0da923433ba51553934ea3d7f38b1e9e18f98 (patch) | |
tree | 75cbfaa4f54e53e9e48b30bef7810f47c4d7fdb7 | |
parent | 22540e9a7abb11ff4e6dca42f8b3d23050defac3 (diff) |
Move Google Analytics settings into <head> tag
-rw-r--r-- | layouts/partials/footer.html | 16 | ||||
-rw-r--r-- | layouts/partials/head.html | 17 |
2 files changed, 17 insertions, 16 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8ed5ea3..2b8aa03 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -93,22 +93,6 @@ {{ "<!-- Main Script -->" | safeHTML }} {{ $script := resources.Get "js/script.js" | minify}} <script src="{{ $script.Permalink }}"></script> -{{ "<!-- google analitycs -->" | safeHTML }} -<script> - (function (i, s, o, g, r, a, m) { - i['GoogleAnalyticsObject'] = r; - i[r] = i[r] || function () { - (i[r].q = i[r].q || []).push(arguments) - }, i[r].l = 1 * new Date(); - a = s.createElement(o), - m = s.getElementsByTagName(o)[0]; - a.async = 1; - a.src = g; - m.parentNode.insertBefore(a, m) - })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); - ga('create', '{{ .Site.Params.googleAnalitycsID }}', 'auto'); - ga('send', 'pageview'); -</script> <!-- cookie --> diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 384d15d..9c143c4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -21,4 +21,21 @@ <link rel="shortcut icon" href="{{ `images/favicon.png` | absURL }} " type="image/x-icon"> <link rel="icon" href="{{ `images/favicon.png` | absURL }} " type="image/x-icon"> + {{ "<!-- google analitycs -->" | safeHTML }} + <script> + (function (i, s, o, g, r, a, m) { + i['GoogleAnalyticsObject'] = r; + i[r] = i[r] || function () { + (i[r].q = i[r].q || []).push(arguments) + }, i[r].l = 1 * new Date(); + a = s.createElement(o), + m = s.getElementsByTagName(o)[0]; + a.async = 1; + a.src = g; + m.parentNode.insertBefore(a, m) + })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); + ga('create', '{{ .Site.Params.googleAnalitycsID }}', 'auto'); + ga('send', 'pageview'); + </script> + </head>
\ No newline at end of file |