diff options
author | Jeremy Bise <jeremy.bise@thosegeeks.com> | 2019-04-16 19:36:02 +0300 |
---|---|---|
committer | Jeremy Bise <jeremy.bise@thosegeeks.com> | 2019-04-16 19:36:02 +0300 |
commit | bcfb3ecbc6bf5377f64cbac174978bbf3f00b83f (patch) | |
tree | cf19ab31e724c94343953cb37c6dc06e97218c6b | |
parent | b0bfb8dc0e85bacf6535832bae4b31053cefc8c0 (diff) |
add analytics, fix closing html tag oops
-rw-r--r-- | layouts/_default/baseof.html | 4 | ||||
-rw-r--r-- | layouts/partials/google-analytics-async.html | 10 |
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 |