Quickly Find Your Google Analytics Code

Update January 29th, 2024 – UA codes are now depreciated and are no longer firing data even if they are present on the website. GA4 (Google Tag) implementations of Analytics are now the dominant implementation. For that, I recommend the Google Tag Assistant. However I have updated below with a sections on how to find your GA4 Google Tag on your website, because that can be a bit challenging to find.


How to Locate Your Google Analytics Codes: Website and Backend

In this guide, I’ll walk you through finding your Google Analytics tracking codes in two ways: directly on your website and within the backend of Google Analytics. Whether you’re looking for a GA4 (G-xxxxxx) code or an older UA (UA-xxxxxxxx-x) code, I’ll show you exactly where to find them and ensure you’re referencing the correct property. Understanding these methods can help streamline tasks like verifying tracking, granting access, or troubleshooting analytics issues. Let’s dive in!

Finding the Codes in Google Analytics:

A) Locating the Google Tag (aka GA4; G-xxxxxxx) in Google Analytics:

The Google Tag in Analytics is located in the Data Stream in the admin. Navigate to the settings (gear icon in the bottom corner). Then located and select “Data Streams” in the Data Collection and modification section. Then select the correct data stream. The Google Tag will be the “Measurement ID” at the top right.

If you see more than one data stream use the Tag Assistant to find the correct tag that is present on the domain you are using.

B) Locating the UA Code in Google Analytics:

There are several methods to quickly find your Google Analytics Property UA number (UA-xxxxxxxx-x). First, sign in to Google Analytics.

The fastest way to find the UA code for each property, is to click “All Accounts” at the top of the screen to activate the dropdown menu, then locate the account and in the middle column and you will see the UA number below the Property (see screenshot). You may find that you have access to several different Accounts and Properties. Note, the UA code is set at the property level, each view will have additional numbers (identifiers) amended to the end of the property UA code.

The secondary way to find the UA code, is to click the gear icon on the bottom left of the screen. The find “Tracking Info” in the middle column (make sure you are in the correct property first). Click on “Tracking Code” and the UA code will be present at the top of the page.

location of Google Analytics UA code-step 1
location of Google Analytics UA code-step 2

Finding the Codes on a Website:

A) Locating the Active GA4 (Google Tag) on the Website:

As mentioned above Google Tag Assistant is the best method. Try it here: https://tagassistant.google.com

B) Locating the Active UA Code on the Website:

Open the website url in a desktop browser. You will need to locate the html source code of the website; also know as “view source” function. Depending on your browser of choice there will be different methods to find the source code; either by mouse, or by keyboard shortcuts.

Important!

I’m seeing multiple hostnames come through my Google Analytics account which means some of you are using my Google Tag code.

Make sure you are on YOUR website when doing this task.

Here are some typical keyboard shortcuts for various browsers to view source code of a website:

  • On Chrome, Mozilla Firefox, and Microsoft Edge: ctrl + U
  • On Safari: Command + Option + U

Or by mouse, find your browser settings; commonly referred to as “Tools,” “Web Developer,” “Settings,” “Page Source.”

To quickly find the UA code in the code, open up your browser on-page search function. This is usually a similar keyboard shortcut such as ctrl+ F, or Command + Option + F (Mac). Search using just “UA-” and you should find it quickly.

What if you don’t see any codes in the website source code or Tag Assistant?

  1. It may not be present in the code. Meaning it is not tracking.
  2. (only if using view source) It may be located in a javascript file. You can try to track it down in the code by clicking files, or you can download a tag identifier like Tag Assistant (by Google) —  an extension for Chrome — there are other tag identifiers out there.
  3. (only if using view source)The website may be using Tag Manager instead of the Analytics Global Site Tag. If they’re using Tag Manager, then you will need Tag Assistant to view the UA code (see previous). You can search for the presents of Tag Manager by searching the source code for “gtm-“.

Get Ahead in 2025!

Master WordPress and Digital Marketing

Launching January 2025, exclusive online courses designed to elevate your skills in WordPress, Google Ads, SEO, and more. Perfect for business owners, marketers, and creators.

Sign up now to receive early access and special course discounts!

rocket pixelated icon image

More Posts

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *