Google Analytics & Tag Manager

Track traffic and conversions on your WordPress site with Google Analytics 4 (GA4) or Google Tag Manager (GTM).

Option 1: Add GA4 with a plugin (recommended)

  1. In Google Analytics, create a GA4 property and a Web data stream for your site’s URL.
  2. Copy your Measurement ID (e.g. G-XXXXXXXXXX).
  3. In WordPress Admin, install a plugin that adds the GA4 snippet, for example:
    • Site Kit by Google — official; connects to your Google account and inserts the tag.
    • GA Google Analytics or Insert Headers and Footers — you paste the Measurement ID or gtag snippet.
  4. Configure the plugin with your Measurement ID and save. The plugin will add the script to your site’s <head> or as recommended.

Google’s setup guide: Set up Analytics for a website.

Option 2: Add GA4 via your theme

If your theme has a “Custom code” or “Header/Footer scripts” option (e.g. in the Customizer or theme settings), you can paste the GA4 gtag snippet there. Get the snippet from Analytics: Admin → Data Streams → your stream → View tag instructions → Install manually.

Use this only if you’re comfortable editing theme settings; a plugin is easier to update and doesn’t depend on the theme.

Option 3: Google Tag Manager (GTM)

GTM lets you manage multiple tags (GA4, ads, other scripts) from one place without editing theme code.

  1. Create a container at tagmanager.google.com for your website.
  2. Copy the two GTM snippets (one for <head>, one for <body>).
  3. Add them using a plugin such as Insert Headers and Footers or DuracellTomi’s Google Tag Manager for WordPress, or your theme’s header/footer script option.
  4. In GTM, add a GA4 Configuration tag and trigger it on All Pages. Publish the container.

Once GTM is on your site, you can add or change GA4 and other tags from the GTM dashboard without touching WordPress.

Traffic and uptime in one place

If your plan includes it, you can connect your GA4 property to the platform’s monitoring dashboard so you see traffic (pageviews, sessions) alongside uptime and response times in one view. Ask support or check your site’s monitoring page for “Connect Google Analytics” when that’s available.