Add the Google Analytics 4 tag

Add the Google Analytics 4 tag to your site with RankKit SEO by pasting your Measurement ID, and keep editors and admins out of your traffic reports.

Updated 2 min read
On this page

GA4 only reports on visits it can see, so every page needs the Google Analytics tag (gtag.js). If no other plugin or your theme adds it yet, RankKit SEO can: paste your Measurement ID and the tag loads on every front-end page.

This is separate from connecting Google. The tag collects data; the connection reads it back into RankKit SEO → Analytics. Most sites need both.

Find your Measurement ID

  1. Open Google Analytics and go to Admin.
  2. Under Data collection and modification, open Data streams and click your web stream.
  3. Copy the Measurement ID. It starts with G-, for example G-ABC123XYZ9.

No property yet? In Admin, click Create → Property, follow the steps and add a Web data stream for your site's URL.

Add the tag in RankKit SEO

  1. Go to RankKit SEO → Settings → Webmaster tools.
  2. In the Google Analytics tag card, paste the ID into GA4 Measurement ID.
  3. Leave Do not track logged-in editors and admins on (the default) so your own visits don't skew the numbers.
  4. Click Save changes.
Setting Default What it does
GA4 Measurement ID Empty The G- ID of your web stream. Empty means RankKit SEO adds no tag.
Do not track logged-in editors and admins On Skips the tag for logged-in users who can edit posts (contributors, authors, editors and administrators).

RankKit SEO only outputs the tag for a valid G- ID. The script loads asynchronously from Google, so it doesn't block your page from rendering.

Check that it works

  1. Open your site in a private browser window (so you're logged out).
  2. In Google Analytics, open Reports → Realtime. Your visit should appear within a minute or two.

You can also view the page source and look for googletagmanager.com/gtag/js?id=G-….

Important Don't add the tag twice. If your theme, Site Kit, a cookie consent tool or another plugin already adds GA4, leave GA4 Measurement ID empty in RankKit SEO. Two tags count every page view twice.

RankKit SEO loads the tag for every visitor except the excluded logged-in users. It doesn't include a cookie banner or consent mode. If your site must ask for consent before analytics runs, add GA4 through your consent management tool instead and leave the RankKit SEO field empty. The RankKit SEO → Analytics reports work the same either way.

FAQ

Do I need the tag if I only want Search Console reports?

No. Search Console data comes from Google Search, not from a tag on your site. The tag is only needed for GA4 numbers such as sessions and visits from AI assistants.

Can I use a Universal Analytics (UA-) or Google Tag Manager (GTM-) ID?

No. The field accepts GA4 Measurement IDs that start with G-. To use Google Tag Manager, add it with another plugin or your theme and leave this field empty.

Why don't I see my own visits in GA4?

Do not track logged-in editors and admins is on, so the tag isn't loaded while you're logged in. Test in a private window or turn the setting off temporarily.

Was this page helpful?

Still need help?

Email us with your WordPress and RankKit SEO versions and what you tried. Pro customers get priority replies.

Contact support