diff options
author | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2018-12-07 12:31:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-07 12:31:22 +0100 |
commit | 4e879a2c304a7fca4ac9b446d72dde5b88c0f62f (patch) | |
tree | 291bb3dfcd3c7cc1bdd2de982098d83f61a91b31 /docs | |
parent | 415f57c5bf6f41421a3bb88d4f250b8fb94376ee (diff) |
Add doc before path to GA in static site (#4940)
##### Summary
Remove mkdocs GA generator (can't be customized)
Add GA code to mkdocs-material footer.html and customize it to add '/doc' before the path, so we can distinguish these hits in GA.
##### Component Name
docs
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/generator/buildyaml.sh | 1 | ||||
-rw-r--r-- | docs/generator/custom/themes/material/partials/footer.html | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/docs/generator/buildyaml.sh b/docs/generator/buildyaml.sh index 7c95682387..1237943907 100755 --- a/docs/generator/buildyaml.sh +++ b/docs/generator/buildyaml.sh @@ -52,7 +52,6 @@ docs_dir: src site_dir: build #use_directory_urls: false strict: true -google_analytics: ["UA-64295674-3", ""] extra: social: - type: "github" diff --git a/docs/generator/custom/themes/material/partials/footer.html b/docs/generator/custom/themes/material/partials/footer.html index 1207966abd..fe232b6d50 100644 --- a/docs/generator/custom/themes/material/partials/footer.html +++ b/docs/generator/custom/themes/material/partials/footer.html @@ -51,3 +51,4 @@ </div> </div> </footer> +<script>!function(e,a,t,n,o,c,i){e.GoogleAnalyticsObject=o,e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,c=a.createElement(t),i=a.getElementsByTagName(t)[0],c.async=1,c.src="https://www.google-analytics.com/analytics.js",i.parentNode.insertBefore(c,i)}(window,document,"script",0,"ga"),ga("create","UA-64295674-3",""),ga("set","anonymizeIp",!0),ga("send","pageview","/doc"+window.location.pathname);var links=document.getElementsByTagName("a");if(Array.prototype.map.call(links,function(a){a.host!=document.location.host&&a.addEventListener("click",function(){var e=a.getAttribute("data-md-action")||"follow";ga("send","event","outbound",e,a.href)})}),document.forms.search){var query=document.forms.search.query;query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})}</script> |