Skip to content

Commit e2fdfd7

Browse files
committed
MNT: Add Google Analytics 4 property tag
1 parent 191f475 commit e2fdfd7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ if [ "$IS_RELEASE" ]; then
5858
ANALYTICS="<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create','UA-43663477-4','auto');ga('require','cleanUrlTracker',{indexFilename:'index.html',trailingSlash:'add'});ga('require','outboundLinkTracker',{events:['click','auxclick','contextmenu']});ga('require', 'maxScrollTracker');ga('require', 'pageVisibilityTracker');ga('send', 'pageview');setTimeout(function(){ga('send','event','pageview','view')},15000);</script><script async src='https://www.google-analytics.com/analytics.js'></script><script async src='https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.1/autotrack.js'></script>"
5959
find "$BUILDROOT" -name '*.html' -print0 |
6060
xargs -0 -- sed -i "s#</body>#$ANALYTICS</body>#i"
61+
ANALYTICS="<script async src='https://www.googletagmanager.com/gtag/js?id=G-C4YF12M4PY'></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-C4YF12M4PY');</script>"
62+
find "$BUILDROOT" -name '*.html' -print0 |
63+
xargs -0 -- sed -i "s#</head>#$ANALYTICS</head>#i"
6164
ANALYTICS='<script data-ad-client="ca-pub-2900001379782823" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>'
6265
find "$BUILDROOT" -name '*.html' -print0 |
6366
xargs -0 -- sed -i "s#</head>#$ANALYTICS</head>#i"

0 commit comments

Comments
 (0)