diff options
author | memnoth <yisooan@gmail.com> | 2017-09-12 06:08:54 +0300 |
---|---|---|
committer | Calin Tataru <calintat@gmail.com> | 2017-09-28 23:30:33 +0300 |
commit | 7f0559d5cc5569d0956a192535eb3a3353a9ff70 (patch) | |
tree | ee1f481bf15358798b32f6084abed6b7207970be | |
parent | a1b371cf9ca00a61c77176d7f9963d81dde2b948 (diff) |
Add google analytics
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/partials/footer.html | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ab5db12..9f87860 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -3,6 +3,7 @@ languageCode = "en-us" title = "Minimal" theme = "minimal" disqusShortname = "username" # delete this to disable disqus comments +googleAnalytics = "" [params] author = "Calin Tataru" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index c5d4fb0..0e30932 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -3,6 +3,16 @@ <p class="copyright text-muted">{{ .Site.Params.copyright | default "© All rights reserved. Powered by [Hugo](https://gohugo.io) and [Minimal](https://github.com/calintat/minimal)" | markdownify }}</p> </footer> + <!-- Global Site Tag (gtag.js) - Google Analytics --> + <script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script> + <script> + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments)}; + gtag('js', new Date()); + + gtag('config', '{{ .Site.GoogleAnalytics }}'); + </script> + </body> |