Where is Google Analytics on WordPress?

Cody Schneider9 min read

Trying to find your Google Analytics settings inside your WordPress dashboard can feel like searching for a specific book in a library without a catalog. You know it must be somewhere, but there isn’t a clear menu item labeled “Google Analytics.” This article will show you exactly how to locate the Google Analytics tracking code on your WordPress site and figure out how it was added.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why You Can't “See” Google Analytics in WordPress

First, it’s helpful to understand that Google Analytics isn't a native part of WordPress. It's a powerful, separate service offered by Google. To make it work, you need to bridge the gap between your WordPress website and your Google Analytics account. This bridge is a small piece of JavaScript code, often called a "tracking snippet" or a "GA tag."

When someone visits your website, this script runs in their browser and sends anonymous data about their activity - like what pages they visited and how long they stayed - to your Google Analytics account. This means “finding Google Analytics on WordPress” is really about finding where that little piece of JavaScript code has been placed on your site.

There are several different methods for adding this code, and your real task is to play detective and figure out which one was used.

How to Check if Google Analytics is on Your Site at All

Before you start digging through your WordPress admin area, the first step is to confirm the tracking code is actually installed and working. Luckily, you don't even need to log into WordPress to do this. Here are the three easiest ways to check.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 1: Use 'View Page Source'

This is the fastest and most direct way to see the raw code of your website and spot the analytics snippet hiding within it.

  1. Open your website's homepage in your web browser (like Chrome, Firefox, or Safari).
  2. Right-click anywhere on the page and select "View Page Source" from the menu. You can also use the keyboard shortcut: Ctrl+U on Windows or Cmd+Option+U on Mac.
  3. A new tab will open, showing you the HTML code for your website. It might look intimidating, but you’re just looking for one thing.
  4. Press Ctrl+F (on Windows) or Cmd+F (on Mac) to open the "Find" bar.
  5. Type `gtag.js` into the search box. This is the script name for Google Analytics 4, the current version. If that doesn’t yield any results, try searching for `analytics.js`, which was used for the older Universal Analytics.

If the code is there, you'll see a script that looks something like this:

&lt,!-- Global site tag (gtag.js) - Google Analytics --&gt,
&lt,script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"&gt,&lt,/script&gt,
&lt,script&gt,
  window.dataLayer = window.dataLayer || [],
  function gtag(){dataLayer.push(arguments),}
  gtag('js', new Date()),
  
  gtag('config', 'G-XXXXXXXXXX'),
&lt,/script&gt,

That G-XXXXXXXXXX line is your Measurement ID. If you see this script in your page source, you have officially confirmed that Google Analytics is installed on your site.

Method 2: Use Browser Developer Tools

For a more technical confirmation that data is actively being sent, you can use your browser’s built-in developer tools.

  1. Navigate to your website.
  2. Right-click on the page and choose "Inspect" to open the developer tools pane.
  3. Click on the "Network" tab within this pane.
  4. With the Network tab open, refresh your web page. You'll see a long list of all the files and data your browser is loading.
  5. In the "Filter" box at the top of the Network tab, type `collect`.
  6. Look for any rows that mention "google-analytics.com." If you see a request made to a URL with `/collect` in the name, it means your browser has successfully sent tracking data to Google Analytics.

Method 3: Use a Browser Extension

One of the most user-friendly methods is to use the Tag Assistant Legacy (by Google) extension for Chrome. It scans the page for you and tells you what Google tags are active.

  1. Install the extension from the Chrome Web Store.
  2. Click the extension's icon in your browser toolbar and click "Enable."
  3. Reload your website's page.
  4. Click the Tag Assistant extension icon again. It will now show you a list of all Google tags it found. If Google Analytics is there, you’ll see it listed with your Measurement ID (e.g., G-XXXXXXXXXX). A green or blue tag icon indicates it’s working correctly.

Where the Google Analytics Tracking Code Lives in WordPress

Now that you've confirmed the tracking code exists, it's time to find where it was added inside your WordPress backend. Here are the most common places to look, starting with the most likely culprits.

1. In a Dedicated WordPress Plugin

For most non-technical users, using a plugin is the safest and most popular way to add Google Analytics to WordPress. Plugins handle the code placement for you, so you never have to touch a theme file. A plugin is almost certainly how it was done if your site was not set up by an advanced developer.

To check for this, follow these steps:

  • In your WordPress dashboard, navigate to Plugins → Installed Plugins.
  • Scan the list for any plugins that mention "Analytics," "Stats," or "Tracking." Popular ones include:

If you find one of these, click on its "Settings" to configure it. That's where you'll find the Google Analytics Measurement ID and other related settings. You've found the home of your GA setup.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

2. Inside Your Theme Options or Customizer

Many modern premium WordPress themes provide a built-in feature to make adding tracking scripts easy, without needing an extra plugin. This keeps things clean and integrated within the theme itself.

  • From your WordPress dashboard, go to Appearance → Customize.
  • Look carefully through the Customizer menu options. The section you're looking for might be named "Additional Scripts," "Header/Footer Scripts," "Tracking Codes," "Integrations," or "General Settings."
  • Explore these sections for a text box where you can paste code snippets. You'll likely see the full Google Analytics `gtag.js` script pasted there.

If your theme doesn't show this in the Customizer, it might have its own dedicated theme options panel. Look for a menu item in your WordPress dashboard that has the name of your theme (e.g., "Avada," "Divi," "GeneratePress"). Navigate through these options to find a similar scripts or integration text-box.

3. Manually Added to a Theme File

This method is more common for developers or more technical users who prefer not to use plugins. It involves directly editing the theme’s code files. Warning: Be very careful if you choose to explore this method, as a small mistake in a theme file can break your entire website.

The code is typically placed in one of two files:

header.php

This file contains the <head> section of your website’s HTML, which is the standard place for tracking scripts.

  • Navigate to Appearance → Theme File Editor.
  • You'll likely see a warning about editing theme files. Click "I understand" to proceed.
  • On the right side of the screen, under "Theme Files," find and click on header.php.
  • Look for the tracking script, which is usually pasted just before the closing </head> tag.

functions.php

A more advanced technique is to use the functions.php file to programmatically inject the script into the site’s header.

  • From the Theme File Editor, select functions.php.
  • Scan the file for a PHP function containing the Google Analytics script, which is being added using an action hook like wp_head. It will look something like this:
function add_google_analytics_code() {
    ?&gt,
    &lt,!-- Global site tag (gtag.js) - Google Analytics --&gt,
    &lt,script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"&gt,&lt,/script&gt,
    &lt,script&gt,
      window.dataLayer = window.dataLayer || [],
      function gtag(){dataLayer.push(arguments),}
      gtag('js', new Date()),
      gtag('config', 'G-XXXXXXXXXX'),
    &lt,/script&gt,
    &lt,?php
}
add_action('wp_head', 'add_google_analytics_code'),
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

4. Set Up via Google Tag Manager (GTM)

Websites aiming for more sophisticated tracking often use Google Tag Manager. GTM is a container that holds a variety of tracking scripts (including Google Analytics, Facebook Pixel, etc.). Instead of adding lots of separate scripts to your site, you just add one GTM script.

You can check for this using the "View Page Source" method again. But instead of looking for gtag.js, you'll be looking for gtm.js. The Google Tag Manager script has two parts: one high in the <head> and one after the opening <body> tag.

If you find the GTM script, it means that Google Analytics is not being managed from your WordPress site directly. It's being fired from within your Google Tag Manager container. You will need to log in to your Google Tag Manager account to manage it there.

What If the Code is in Multiple Places?

Sometimes, in an attempt to get it working, people accidentally add the tracking code multiple times - for example, via a plugin and in the theme options. This is a bad practice known as double tracking and can seriously skew your data.

Signs of double tracking include:

  • A bounce rate that is almost zero percent.
  • Pageviews that are exactly double your number of unique visitors.

If you find the script in more than one location, choose one method to be your single source of truth (a plugin or Google Tag Manager are recommended) and carefully delete the others. This will ensure your analytics data is accurate and reliable.

Final Thoughts

Finding where Google Analytics lives on your WordPress site boils down to first checking if the tracking code is active on the front end, then investigating a few key locations in your backend - namely your plugins, theme settings, and theme files. Nine times out of ten, you’ll find it’s being managed by a plugin or integrated directly into your theme's options panel.

Once you’ve found the tracking code, the real work begins: turning all that raw data into meaningful business insights. For many teams, this means hours spent exporting data into spreadsheets and manually building reports. We believe this process should be much easier. Using Graphed, you can connect your Google Analytics account in seconds and create real-time dashboards just by describing what you want to see in simple, natural language, freeing you up to focus on strategy instead of report-building.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!