Skip to content

Commit

Permalink
Ship google analytics javascript in head.hbs
Browse files Browse the repository at this point in the history
Upstream mdbook deprecates its included google analytics in order not
to prefer one analytics engine over all others.

Part of #77

Signed-off-by: Klaus Kämpf <kkaempf@suse.de>
  • Loading branch information
kkaempf committed Nov 30, 2021
1 parent 2bfe229 commit a578032
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ git-repository-url = "https://github.com/kubewarden/docs"
edit-url-template = "https://github.com/kubewarden/docs/edit/main/{path}"
site-url = "/"
cname = "docs.kubewarden.io"
google-analytics = "UA-56382716-13"
11 changes: 11 additions & 0 deletions theme/head.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{!-- Put your head HTML text here --}}
<script type="text/javascript">
(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','https://www.google-analytics.com/analytics.js','ga');
ga('set','anonymizeIp',!0);
ga('create', 'UA-56382716-13', 'auto');
ga('send', 'pageview');
</script>

0 comments on commit a578032

Please sign in to comment.