How to Check Google Analytics Code on Website
Verifying that your Google Analytics code is installed and firing correctly is the first step to understanding your website's performance. Without it, you’re flying blind. This guide will walk you through four simple methods to check if your Google Analytics setup is working, ranging from quick visual checks to definitive tests right inside the platform.
Method 1: Check Your Website’s Source Code
The most direct way to check for the Google Analytics code is to look for it in your website’s HTML source. This tells you if the tracking script has been added to the page, even if it doesn’t confirm it’s firing correctly. It’s a great first step.
How to View Page Source
In most modern web browsers like Google Chrome, Firefox, or Safari, you can view the source code of any web page with a simple right-click.
Navigate to your website.
Right-click anywhere on the page (but not on an image).
Select "View Page Source" from the context menu. This will open a new tab showing the raw HTML code of your site.
Alternatively, you can use keyboard shortcuts:
Windows:
Ctrl + UMac:
Command + Option + U
What to Look For
Once you’re viewing the source code, you need to search for the Google Analytics tracking script. The exact code snippet will depend on whether you are using the newer Google Analytics 4 or the older Universal Analytics (UA).
Use your browser's find function (Ctrl + F or Command + F) and search for the following:
For Google Analytics 4 (Recommended):
Search for "gtag.js". You are looking for a block of code that looks like this, typically located within the <head> section of your HTML:
The most important part is the line that includes your Measurement ID, which starts with "G-" (e.g., G-XXXXXXXXXX). Make sure this ID matches the one shown in your Google Analytics account admin section.
For Universal Analytics (Older Version):
Search for "analytics.js". The UA tracking code looks a bit different:
Here, you’ll want to verify your Tracking ID, which starts with "UA-" (e.g., UA-XXXXXXXX-X).
What If You Use Google Tag Manager?If you use GTM to deploy your tags, you won't find the GA code snippet directly. Instead, you'll look for the GTM container code, which also starts with "googletagmanager". It looks like this:
If you see the GTM code, your next step would be to log in to your Google Tag Manager account to confirm the GA4 or UA tag is configured and published correctly there.
Method 2: Use Browser Developer Tools
Developer tools, built into modern browsers, allow you to see all the network requests your website makes in the background. This is a powerful way to confirm that your site is successfully sending information (called a "hit") to Google’s servers.
How to Use the Network Tab
Go to your website.
Open Developer Tools. You can do this by right-clicking on the page and choosing "Inspect," or by using these shortcuts:
Windows:
F12orCtrl + Shift + IMac:
Command + Option + I
In the panel that opens, click on the "Network" tab.
With the Network tab still open, refresh your web page. You will see a list of all the files and requests your browser is making.
In the "Filter" box at the top of the request list, type collect or google-analytics to narrow down the results.
What to Look For
If your Google Analytics code is installed and firing, you should see one or more requests appear in the list. For GA4, the request will typically start with collect?v=2&....
Seeing a request here is a very strong sign that your setup is working. It means your browser successfully executed the tracking script and sent a pageview hit to Google’s collection servers. Double-check that the request has a "Status" of 200, which means the request was successfully received.
You can even click on the request name and look at the "Headers" tab to see your Measurement ID (labeled as tid) being sent along with the hit data.
Method 3: Use a Browser Extension
If digging through code or network requests isn't for you, browser extensions offer a much more user-friendly way to see what tracking tags are active on a site. This is often the easiest and fastest method for a quick check.
The most popular extension for this is Tag Assistant Legacy (by Google), available for Google Chrome.
How to Use Google Tag Assistant
Install the "Tag Assistant Legacy (by Google)" extension from the Chrome Web Store.
Once installed, navigate to your website.
Click the blue Tag Assistant icon in your browser's toolbar.
A small window will pop up. Click the "Enable" button.
Refresh your website.
What to Look For
After refreshing the page, click the Tag Assistant icon again. It will now show a list of all Google tags it found on your page, including Google Analytics, Google Tag Manager, and Google Ads tags.
Next to each tag, you'll see a color-coded indicator:
Green: Great news! This means the tag was found and is working correctly. A blue tag usually just provides minor suggestions for improvement but is generally a good sign.
Yellow: This indicates a minor issue with your tag setup. Tag Assistant will provide details on what might be wrong, such as non-standard code placement. Your data is likely being collected, but it might not be perfect.
Red: This signals a critical problem. The tag is found but isn't working at all, and no data is being collected. Click on the tag for specific error details.
This extension is invaluable not just for seeing if the code exists, but for helping you diagnose potential implementation problems.
Method 4: Check Real-Time Reports in Google Analytics
Of all the methods, this one is the most definitive. It confirms not only that your tracking code is on the site and firing correctly, but also that the data is arriving in the correct Google Analytics property. You’re not just checking the wiring, you’re seeing the electricity flow.
How to Use Realtime Reports
Log in to your Google Analytics account. Make sure you've selected the correct GA4 property from the dropdown menu at the top.
In the left-hand navigation menu, go to Reports → Realtime.
This will open the Realtime dashboard, which shows activity happening on your site right now.
Keep this tab open. In a separate browser window (an incognito window works great for this) or on your phone, visit your website.
Navigate to a few different pages.
What to Look For
Go back to your Google Analytics Realtime report tab. Within about 30-60 seconds, you should see the number of "Users in last 30 minutes" change to at least 1. The charts and maps will update to reflect your location and the page you're currently viewing.
If you click around your site, you’ll see the "Views by Page title and screen name" card update with the titles of the pages you're visiting.
If a visitor shows up in the Realtime report, you can be 100% confident that your basic Google Analytics configuration is working correctly. If nothing appears after a few minutes, double-check that you're looking at the right Analytics property and then revisit the previous methods to troubleshoot the installation.
Final Thoughts
Confirming your Google Analytics code is installed is a crucial checkpoint for any website owner or marketer. By using the page source, developer tools, a browser extension, or the definitive Realtime report, you can quickly verify your setup and ensure you're capturing the data you need to make informed decisions.
Verifying the code is the start, but the real work begins when you have to make sense of all the data from Google Analytics and connect it with performance metrics from your other marketing platforms. To help with that, we built Graphed to be your AI data analyst. You can connect sources like Google Analytics, Shopify, and Facebook Ads in seconds, then use plain English to build real-time dashboards and reports. Instead of spending hours pulling data manually, you can ask questions like "Which campaigns are driving the most revenue this month?" and get an instant, unified view of your performance.