Google Analytics 4 Tracking Code
GA4 base snippet that loads the gtag.js library and initialises your Measurement ID — replace G-XXXXXXXXXX with your actual ID before activating.
HTMLby SnipCraft
html
<!-- Google Analytics 4 -->
<!-- IMPORTANT: Replace both instances of G-XXXXXXXXXX with your GA4 Measurement ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>#analytics#ga4#google#scripts#tracking