diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-06-19 12:19:01 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-06-19 12:19:01 +0100 |
commit | 25d616e765a2617b8c284f06f9682cd9bce01d7a (patch) | |
tree | 1f0188de6253f3b8ebf470700a09b6fc0f89c703 | |
parent | Use new ice paths (diff) | |
download | gentoobrowse-25d616e765a2617b8c284f06f9682cd9bce01d7a.tar.bz2 gentoobrowse-25d616e765a2617b8c284f06f9682cd9bce01d7a.tar.xz gentoobrowse-25d616e765a2617b8c284f06f9682cd9bce01d7a.zip |
Update to GA4
-rw-r--r-- | gentoobrowse/js/googletracking.js | 17 | ||||
-rw-r--r-- | gentoobrowse/xslt/base.xslt | 1 |
2 files changed, 8 insertions, 10 deletions
diff --git a/gentoobrowse/js/googletracking.js b/gentoobrowse/js/googletracking.js index 62c38cd..27e4f92 100644 --- a/gentoobrowse/js/googletracking.js +++ b/gentoobrowse/js/googletracking.js @@ -1,10 +1,7 @@ -var _gaq = _gaq || []; -_gaq.push(['_setAccount', 'UA-19177673-1']); -_gaq.push(['_trackPageview']); - -(function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); -})(); - +window.dataLayer = window.dataLayer || []; +function gtag() +{ + dataLayer.push(arguments); +} +gtag('js', new Date()); +gtag('config', 'G-0JDJB4S82Q'); diff --git a/gentoobrowse/xslt/base.xslt b/gentoobrowse/xslt/base.xslt index 4df49f6..73e906f 100644 --- a/gentoobrowse/xslt/base.xslt +++ b/gentoobrowse/xslt/base.xslt @@ -170,6 +170,7 @@ <script src="https://code.jquery.com/jquery-latest.min.js"></script> <script src="{$tbscdn}/js/bootstrap.min.js"></script> <script src="/js/js.js"></script> + <script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-0JDJB4S82Q"/> <script src="/js/googletracking.js" /> </body> </html> |