Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jeremybise/twentynineteen-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bise <jeremy.bise@thosegeeks.com>2019-04-16 19:36:02 +0300
committerJeremy Bise <jeremy.bise@thosegeeks.com>2019-04-16 19:36:02 +0300
commitbcfb3ecbc6bf5377f64cbac174978bbf3f00b83f (patch)
treecf19ab31e724c94343953cb37c6dc06e97218c6b
parentb0bfb8dc0e85bacf6535832bae4b31053cefc8c0 (diff)
add analytics, fix closing html tag oops
-rw-r--r--layouts/_default/baseof.html4
-rw-r--r--layouts/partials/google-analytics-async.html10
2 files changed, 13 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 0ce565b..589f156 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -51,4 +51,6 @@
{{ block "footer_scripts" . }}
<!-- Optional footer scripts. -->
{{ end }}
-</body> \ No newline at end of file
+ {{ partial "google-analytics-async.html" . }}
+</body>
+</html> \ No newline at end of file
diff --git a/layouts/partials/google-analytics-async.html b/layouts/partials/google-analytics-async.html
new file mode 100644
index 0000000..8a58c07
--- /dev/null
+++ b/layouts/partials/google-analytics-async.html
@@ -0,0 +1,10 @@
+{{ if not $.Site.IsServer }}
+ {{ with $.Site.GoogleAnalytics }}
+ <script>
+ window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
+ ga('create', '{{ . }}', 'auto');
+ ga('send', 'pageview');
+ </script>
+ <script async src='https://www.google-analytics.com/analytics.js'></script>
+ {{ end }}
+{{ end }} \ No newline at end of file