Description
I'm submitting a ...
- bug report
- feature request
- other (Please do not submit support requests here (below))
Setting up a new Google Analytics tracking ID provides a new Google Analytics 4 ID (starts with G-
) and no longer provides a Universal Analytics tracking ID (starting with UA-
). As such, the script we include by default in HTML5 Boilerplate is no longer useful to users creating a new site. Google Analytics 4 has been the default for a while now
Google Analytics 4 is very different to Universal Analytics and actually includes many of the features which we're written about in our docs and provided custom JavaScript for such as, automatically anonymizing the full IP address,
Google do not recommend Universal Analytics being installed on new sites and are actively contacting users who are still using Universal Analytics to upgrade to GA4 so I think it's time to remove the Universal Analytics script from index.html
. It could be possible to replace the script with the GA4 script, but I don't think it provides any value to anyone since the script is exactly the same as what Google provides:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1234567890"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-M00XN4KSVF');
</script>