Skip to content

Commit bbdb75e

Browse files
committed
Add google analytics
1 parent a6e7320 commit bbdb75e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

_output.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
bookdown::gitbook:
22
split_by: rmd
3+
includes:
4+
in_header: [ga_script.html]
35
config:
46
toc:
57
collapse: section

ga_script.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- Global site tag (gtag.js) - Google Analytics -->
2+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-142542392-1"></script>
3+
<script>
4+
window.dataLayer = window.dataLayer || [];
5+
function gtag(){dataLayer.push(arguments);}
6+
gtag('js', new Date());
7+
8+
gtag('config', 'UA-142542392-1');
9+
</script>
10+

0 commit comments

Comments
 (0)