How to Check if Google Analytics Code Is Working

Cody Schneider7 min read

Nothing is more frustrating than making big decisions based on bad data. If your Google Analytics tracking code isn't installed or working correctly, you're flying blind, missing out on crucial insights about your website visitors. This guide will walk you through a few simple, reliable methods, from a quick 30-second check to more advanced tools, to verify that your Google Analytics 4 tag is firing perfectly.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Easiest & Fastest: The Google Analytics Realtime Report

The simplest way to see if Google Analytics is receiving data from your website is to use its own Realtime report. This report shows you activity on your site as it happens, giving you immediate confirmation that your tracking code is alive and well.

Here’s how to do it step-by-step:

  1. Open Google Analytics: Log in to your Google Analytics account and navigate to the correct property for your website.
  2. Go to the Realtime Report: On the left-hand navigation panel, go to Reports > Realtime. This will open a dashboard that shows live user activity.
  3. Visit Your Website: In a separate browser tab or window, open your website. For the best results, use an Incognito or private browsing window. This prevents your browser cookies or extensions from interfering and ensures you look like a brand new visitor to Google Analytics.
  4. Look for Your Visit: Flip back to the Realtime report tab. Within a minute or so, you should see the number of "Users in last 30 minutes" turn to 1 (or increase by one). You might also see your visit appear on the map and in the cards showing which pages users are viewing.

If you see your activity pop up, congratulations! Your basic GA4 tracking code is working. If nothing appears after a couple of minutes, don't panic. Try one of the other methods below to help diagnose what might be wrong.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Intermediate: Check Your Website’s Source Code

This method doesn't confirm that data is being sent to Google Analytics, but it does confirm that the tracking script has actually been placed on your website. It’s a great second step in troubleshooting if the Realtime report isn’t showing anything.

How to View the Page Source

Every web browser allows you to see the underlying HTML code that builds a webpage. Here’s how to access it:

  • Simple Method: On your website, right-click anywhere on the page (not on an image) and select "View Page Source," "Show Page Source," or a similar option from the menu.
  • Developer Tools Method: Right-click and choose "Inspect" or press F12 on your keyboard (or Cmd+Option+I on a Mac). This will open up a panel with more advanced developer tools. Go to the "Elements" tab to browse the page's HTML.

What to Look For

Once you have the source code visible, you need to find the Google Analytics script. You don't have to read all the code - just use the find feature:

  1. Press Ctrl+F (on Windows/Linux) or Cmd+F (on Mac) to open a search box.
  2. First, search for gtag.js. This is the name of the core Google Global Site Tag library. If you find this, it's a good sign.
  3. Next, search for your Measurement ID. For Google Analytics 4, this starts with a "G-" and looks like this: G-XXXXXXXXXX. You can find your ID in Google Analytics under Admin > Data Streams > [Your Web Stream].

Seeing your gtag.js script and unique G- Measurement ID in the source code — ideally within the <head> section of the HTML — confirms that the code is present on the page. If it’s not there, it means your tag was never installed correctly, or a recent website change removed it. You’ll need to re-install it by adding the code snippet to your website or by configuring your CMS plugin (like adding the ID to a WordPress or Shopify app).

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Advanced/Recommended: Google Tag Assistant

For the most reliable and thorough check, Google's own tool, Tag Assistant, is the way to go. It simulates a visit to your website and gives you a detailed diagnostics report showing exactly which tags fired, what data they sent, and whether any errors occurred. It may sound technical, but it's quite straightforward to use.

The latest version of Tag Assistant is web-based, so you don't even need to install a browser extension anymore.

Here’s how to use it:

  1. Open Tag Assistant: Navigate to tagassistant.google.com.
  2. Add Your Domain: Click the "Add domain" button, enter your website’s full URL (e.g., https://www.yourwebsite.com), and click "Connect."
  3. Start the Debug Session: A new browser tab or window will open with your website. In the bottom-right corner, you’ll see a small “Tag Assistant Connected” overlay. Don’t close this tab! This is your live test window.
  4. Review the Results: Now go back to the original Tag Assistant tab. You should see a "Connected!" message. On the left side of the screen, you will see a summary of the tags found on the page.
  5. Look for Your Google Analytics Tag: Click on your Google Analytics Measurement ID (your G-XXXXXXXXXX ID) from the list.
  6. Check for Fired Events: In the "Output" section for your tag, you should see events that were sent to Google Analytics. At minimum, a page_view event should appear with a green checkmark next to it.

Tag Assistant can tell you more than just if the tag is working. It can confirm the specific data sent (like the page title and URL) and diagnose errors, like a malformed tag or a syntax error in your setup. If you're also tracking other events, such as button clicks or video plays, you can interact with your website in the debug window (e.g., click the button) and watch in the Tag Assistant window to see if those specific events fire as expected.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Common Problems and Quick Fixes

If you've run these checks and discovered your GA4 code isn't working, here are some of the most common culprits:

  • Code in the Wrong Location: The Google Analytics script should be placed high up in the <head> section of your website’s HTML. If it's placed low in the <body> or the <footer>, slow-loading pages may stop rendering before the script has a chance to execute.
  • Incorrect or Mismatched Measurement ID: It happens to the best of us. Double-check that the G- ID on your website’s code exactly matches the Measurement ID shown in your Google Analytics data stream settings. One wrong character will send your data into the void.
  • CMS Plugin or Theme Issues: If you use a system like WordPress, Shopify, or Squarespace, you're likely adding your Measurement ID through a plugin or a theme setting. Make sure your plugin/theme is up to date, check that the ID is saved in the correct field, and see if there are any known conflicts. Sometimes temporarily deactivating other plugins can help you find a culprit.
  • Website Caching: Your browser or your website’s server might be storing an old "cached" version of your site from before you added the code. Try doing a hard refresh (Ctrl+Shift+R or Cmd+Shift+R) and clearing your browser cache. If you use a server-side caching plugin or service, clear its cache as well.
  • Cookie Consent Banners: Many cookie consent tools will block analytics scripts from running until a visitor explicitly gives consent. This is correct behavior, but make sure you’re clicking "Accept" or "Agree" on your cookie banner when you’re testing your website to allow the tags to fire.

Final Thoughts

Regularly confirming that your Google Analytics code is working is essential for maintaining a reliable source of data about your website. By using the Realtime report, inspecting your page's source code, or leveraging the powerful Google Tag Assistant, you can quickly diagnose and fix any tracking issues to keep your data flowing accurately.

Once you are confident in your data collection, the next challenge is turning all that data into meaningful insights without spending hours stuck in reporting tools. At Graphed, we help you connect all your tools - from Google Analytics and Ads to Shopify or Salesforce - in one place. Instead of building manual reports, you simply ask questions in plain English, and our AI data analyst instantly creates live, real-time dashboards for you. We free you from the endless grind of building reports so you can focus on making smarter decisions, faster.

Related Articles