diff options
author | Themefisher Dev <themefisher.dev@gmail.com> | 2020-02-29 08:19:28 +0300 |
---|---|---|
committer | Themefisher Dev <themefisher.dev@gmail.com> | 2020-02-29 08:19:28 +0300 |
commit | 2f10f8c18bc1342b01228c3221f555dd98844ac1 (patch) | |
tree | 6662e9b415b199e3de15316a2ca97b64e6bde40c | |
parent | 8ab876b749f84188c0d7cf29b576c52fce6eb746 (diff) |
modified google analytics
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/partials/footer.html | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9dca62c..da743c1 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -66,7 +66,7 @@ address = "125/A, CA Commercial Area, California, USA" author = "Johnathan Smith" description = "This is meta description" # google analitycs -google_analitycs_id = "Your ID" +google_analitycs_id = "" # Your ID # copyright copyright = "Copyrighht © 2020 a theme by [gethugothemes](https://gethugothemes.com)" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 875ef2c..9694573 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -62,15 +62,19 @@ {{ range .Site.Params.plugins.js}} <script src="{{ .URL | absURL }}"></script> {{ end }} + {{ "<!-- Main Script -->" | safeHTML }} {{ $script := resources.Get "js/script.js" | minify}} <script src="{{ $script.Permalink }}"></script> + {{ "<!-- google analitycs -->" | safeHTML }} +{{ with .Site.Params.google_analitycs_id }} <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.google_analitycs_id }}', 'auto'); + ga('create', '{{ . }}', 'auto'); ga('send', 'pageview'); </script> +{{ end }}
\ No newline at end of file |