How do I add Google Analytics to WordPress?

The easiest way is Google’s free Site Kit plugin: install it under Plugins, Add New, sign in with Google and pick or create your GA4 property, and it adds the tag for you. You can also paste the Google tag with a header plugin. Avoid pasting it into your theme, which an update can wipe, and add a cookie banner for EU visitors.

Create a free accountFree for up to three sites. No card needed.

Updated 1 December 2026

  1. In WordPress, go to Plugins → Add New and search for Site Kit by Google.
  2. Install and activate it, then follow the setup and sign in with your Google account.
  3. Choose to set up Analytics and pick or create a GA4 property.
  4. Site Kit adds the tag to every page. You also get Search Console in the same dashboard.

With a header plugin

  1. In Google Analytics, open Admin → Data streams, pick your web stream and copy the Google tag.
  2. Install a plugin that adds code to the site header, and paste the tag there.
  3. Don’t also run Site Kit, or visits count twice.

Check that it works

Open your site in a private window, accept cookies and look at Realtime in Google Analytics.

Google Analytics sets cookies, so EU visitors must accept first, and the ones who decline are missing. If you would rather skip the banner, see the best analytics for WordPress and the Okidoki WordPress guide.

Ask your website. Get answers right away.

Free for 3 sites. No credit card, no cookies, no code to touch.

Or look around a live demo first, no account needed →