How to Get Google Analytics Tag

Cody Schneider8 min read

Finding your Google Analytics tag is the first critical step to understanding how people find and interact with your website. This small snippet of code is the key to unlocking valuable data about your audience, from their location to the content they love most. This guide will walk you through exactly where to find your Google Analytics 4 tag and what to do with it once you have it.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

GA4 vs. Universal Analytics: A Quick Primer

Before hunting for your tag, it's important to know which version of Google Analytics you're using. For years, Universal Analytics (UA) was the standard. You could spot it by its Tracking ID, which always started with "UA-" (e.g., UA-12345678-1).

However, as of July 1, 2023, Google has officially replaced Universal Analytics with Google Analytics 4. All new analytics properties are created in GA4, which uses a new data model and a different type of identifier called a Measurement ID. A GA4 Measurement ID starts with "G-" (e.g., G-ABCDE12345).

The core concept is the same: both use a snippet of JavaScript, called the global site tag (or gtag.js), to send data from your website to Google Analytics. This article focuses on finding the tag for the current GA4 standard, but we'll also briefly cover where to find a legacy UA code if you need it.

How to Get Your Google Analytics 4 Tag

For any new website or setup, this is the process you'll follow. Finding your GA4 tag involves navigating to a section called "Data Streams," which represents the flow of data from your website or app into your Analytics property.

Here’s the step-by-step guide to locating your Measurement ID and the full gtag.js code snippet.

Step 1: Log in and Navigate to Admin

First, log in to your Google Analytics account. Once you're on the main dashboard, look for the Admin gear icon in the bottom-left corner of your screen and click on it.

This will take you to the administration panel, where you can manage your account and property settings.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Step 2: Go to Data Streams

The Admin screen is divided into two columns: Account and Property. Make sure you have the correct account and property selected in the dropdowns at the top of these columns.

In the Property column, find and click on Data Streams. This is where you configure the sources of data for your GA4 property, which for most people will be a website.

Step 3: Select Your Web Data Stream

You'll see a list of your data streams. If you've just set up your property, you will likely only see one listed, typically named after your website's URL. Click on the data stream for your website to open its details.

Step 4: Find Your Measurement ID

As soon as you open the Web stream details, your Measurement ID will be clearly visible in the top-right corner. It will be labeled and start with "G-".

You can easily copy this ID by clicking the small copy icon next to it.

This "G-" ID is often all you need if you're using a website builder plugin or a CMS integration (like on WordPress, Shopify, or Squarespace) that has a dedicated field for Google Analytics. You can simply paste this ID into the correct field, and the platform will handle the rest.

Step 5: View the Full Tag Instructions (gtag.js)

If you need the full JavaScript code snippet to install it manually on your site, you will need to dig one step deeper. On the same Web stream details page, scroll down to the bottom where you'll see a heading called "View tag instructions". Click on it.

This will open a new page with installation instructions. You will see two tabs: “Install with a website builder” and “Install manually.”

Click on the Install manually tab. Here, you'll find the complete JavaScript code block, also known as the global site tag (gtag.js). It will look something like this:

`<-- Google tag (gtag.js) --><br>

<script async src="https://www.googletagmanager.com/gtag/js?id=G-ABCDE12345"></script>

<script> window.dataLayer = window.dataLayer || [], function gtag(){dataLayer.push(arguments),} gtag('js', new Date()), gtag('config', 'G-ABCDE12345'), </script>`

You can use the copy button in the top-right of the code block to copy the entire snippet to your clipboard. This is the code you will paste into your website's HTML.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

What Do You Do with the Tag? 3 Common Installation Methods

Once you've found your GA tag, the next step is to add it to your website so it can start collecting data. The code needs to be on every single page you want to track.

1. Manual Installation

This method involves editing your website's core files. If you're comfortable with HTML, you can paste the full gtag.js snippet you just copied directly into your site's code. It should be placed in the <head> section of every page, immediately after the opening <head> tag.

Best for: Simple, custom-coded websites where you have direct access to the HTML templates.

2. Using a CMS Plugin or Theme Setting

Most modern website builders and content management systems (CMS) make this process much easier. Platforms like WordPress, Shopify, Wix, and Squarespace have specific sections in their settings where you can just paste your Measurement ID ("G-XXXXX").

  • For WordPress: Tools like the Google Site Kit plugin, MonsterInsights, or even fields built into your theme's settings allow you to add your ID without touching any code.
  • For Shopify: Navigate to Online Store > Preferences. You’ll find a section for Google Analytics where you can paste your ID.

Best for: Almost everyone using a popular CMS. It's the simplest and safest method.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

3. Google Tag Manager (GTM)

Google Tag Manager is a more advanced, free tool that acts as a container for all your website tags (like Google Analytics, Facebook Pixel, Ads conversion tracking, etc.). Instead of adding multiple code snippets to your site, you add the GTM container once, and then manage all your tags from within the GTM interface.

While it has a slightly steeper learning curve, it's the most flexible and scalable solution for managing website tracking. To add your GA4 tag, you’d create a new "Google Analytics: GA4 Configuration" tag inside GTM and paste your Measurement ID there.

Best for: Marketers and businesses who plan to use multiple tracking services or want granular control over event tracking without editing code.

How to Verify Your Tag is Working

After installing your tag, you'll want to make sure it's firing correctly. Here are two easy ways to check:

  1. Use the Realtime Report: Go to your Google Analytics property and click on Reports > Realtime. Open your website in a new browser tab or on your phone. Within a minute or so, you should see yourself as an active user on the map and in the charts. If you see activity, it works!
  2. Google Tag Assistant: Use the free Tag Assistant Legacy Chrome extension. Navigate to your website, enable the extension, and reload the page. It will scan for Google tags and tell you if your GA4 tag was found and if there are any errors.

How to Find Your Old Universal Analytics (UA) Tag

If you're maintaining an older site or need to find your legacy UA Tracking ID for some reason, the process is slightly different.

  1. Navigate to Admin.
  2. Make sure you've selected your UA property (which will likely have a "UA-" prefix in its name).
  3. In the Property column, click on Tracking Info, then click Tracking Code.
  4. On this page, you'll see your Tracking ID (e.g., UA-12345678-1) and the associated global site tag snippet.

Remember, UA properties no longer process new data, so this is mainly for historical reference or specific legacy integrations.

Final Thoughts

Getting your Google Analytics tag is a simple process once you know where to look. Head to the Admin section, open your Data Stream, and you'll find both the "G-" Measurement ID for simple integrations and the full gtag.js script for manual installation. Adding this to your site correctly is the foundational step for data-driven marketing.

Once you've installed your Google Analytics tag and data starts flowing in, the next challenge is making sense of it all. Instead of spending hours in complex reports, we built a tool to help you get answers instantly. After you connect your Google Analytics account to Graphed, you can ask questions in plain English like "Show me my top landing pages by organic sessions this month" and get a live, interactive dashboard in seconds. We connect all your marketing and sales data in one place, so you can spend less time pulling reports and more time acting on insights.

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!