Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Google Analytics 4

Adds the Google Analytics 4 tag to every page. Visits by administrators aren’t counted.

  • Type HTML
  • Runs Public site, in <head>
  • Tested with WordPress 7.1

Fill in your details first. Replace G-XXXXXXXXXX (twice) with your measurement ID from Google Analytics > Admin > Data streams.

HTML
<!-- Replace G-XXXXXXXXXX (twice) with your 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>

Good to know

In the EU, load it only after consent: use your cookie banner, the Consent Mode snippet, or Snipfire Pro’s cookie consent setting.

Comes with a rule

It doesn't run for administrators, so your own visits don't count in your statistics. You can change the rule after installing.

In these packs

  • Analytics and pixels: The usual tracking codes, ready to paste your ID into. Administrators’ visits aren’t counted.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.