Add google analytics (#745)

This commit is contained in:
Mara Averick 2019-01-08 08:45:50 -05:00 committed by Hadley Wickham
parent 323a84bd45
commit ce824d0a33
3 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ _main.rds
_book
*.md
*.html
!ga_script.html
search_index.json
libs
*.rds

View File

@ -1,4 +1,6 @@
bookdown::gitbook:
includes:
in_header: [ga_script.html]
config:
toc:
collapse: section

9
ga_script.html Normal file
View File

@ -0,0 +1,9 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-115082821-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-115082821-1');
</script>