Skip to content

Commit c9712e0

Browse files
committed
MNT: build.sh: Replace defunct gtag.js with analytics.js
1 parent 7027263 commit c9712e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ PYTHONWARNINGS='ignore::UserWarning' \
5656
if [ "$IS_RELEASE" ]; then
5757
echo -e '\nAdding GAnalytics code\n'
5858

59-
ANALYTICS="<script>window.dataLayer=[['js',new Date()],['config','UA-43663477-4']]</script><script async src='https://www.googletagmanager.com/gtag/js?id=UA-43663477-4'></script>"
59+
ANALYTICS="<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create','UA-43663477-4','auto');ga('send','pageview');</script><script async src='https://www.google-analytics.com/analytics.js'></script>"
6060
find "$BUILDROOT" -name '*.html' -print0 |
61-
xargs -0 -- sed -i "s#<head>#<head>$ANALYTICS#i"
61+
xargs -0 -- sed -i "s#</body>#$ANALYTICS</body>#i"
6262
fi
6363

6464

0 commit comments

Comments
 (0)