Skip to content

Commit 8d70d18

Browse files
committed
Manage GTAG
1 parent b7cc90a commit 8d70d18

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

book.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"copy-code-button",
88
"github",
99
"sitemap",
10-
"ga",
11-
"scripts",
1210
"anchors",
1311
"head-append",
1412
"insert-logo"
@@ -29,12 +27,6 @@
2927
"sitemap": {
3028
"hostname": "https://noriste.github.io/reactjsday-2019-testing-course/"
3129
},
32-
"ga": {
33-
"token": "UA-142637808-2"
34-
},
35-
"scripts": {
36-
"files": ["utils/ga-anonymize-ip.js"]
37-
},
3830
"head-append": {
3931
"code": [
4032
"<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"https://noriste.github.io/reactjsday-2019-testing-course/assets/favicons/apple-touch-icon.png\">",
@@ -45,7 +37,16 @@
4537
"<link rel=\"shortcut icon\" href=\"https://noriste.github.io/reactjsday-2019-testing-course/assets/favicons/favicon.ico\">",
4638
"<meta name=\"msapplication-TileColor\" content=\"#ffffff\">",
4739
"<meta name=\"msapplication-config\" content=\"https://noriste.github.io/reactjsday-2019-testing-course/assets/favicons/browserconfig.xml\">",
48-
"<meta name=\"theme-color\" content=\"#50ade5\">"
40+
"<meta name=\"theme-color\" content=\"#50ade5\">",
41+
"<!-- Global site tag (gtag.js) - Google Analytics -->",
42+
"<SCRIPTTAG async src=\"https://www.googletagmanager.com/gtag/js?id=UA-142637808-2\"></SCRIPTTAG>",
43+
"<SCRIPTTAG>",
44+
" window.dataLayer = window.dataLayer || [];",
45+
" function gtag(){dataLayer.push(arguments);}",
46+
" gtag('js', new Date());",
47+
"",
48+
" gtag('config', 'UA-142637808-2', { 'anonymize_ip': true });",
49+
"</SCRIPTTAG>"
4950
]
5051
},
5152
"insert-logo": {

utils/ga-anonymize-ip.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)