How to Create Google Analytics Tracking ID

Cody Schneider8 min read

Setting up Google Analytics is one of the first - and most important - steps you can take to understand your website's audience. To do that, you need a unique piece of code that acts as a fingerprint for your site. This article walks you through exactly how to get your Google Analytics tracking ID, a process that has changed significantly with the move to the new Google Analytics 4.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

What Exactly is a Google Analytics Tracking ID?

Think of a Google Analytics tracking ID as your website's personal mailing address for data. When a user visits your site, this ID tells Google Analytics exactly where to send information about that visit, like which page they viewed, how long they stayed, and where they came from. Without it, Google has no way to connect user activity to your specific Analytics account.

Historically, this ID was called a "Tracking ID" and it always started with "UA-," which stood for Universal Analytics. However, Google has now fully transitioned to a new, more powerful version called Google Analytics 4. With this change, the old Universal Analytics has been retired, and the tracking ID has a new name and format.

  • Old Universal Analytics Tracking ID: Followed the format UA-XXXXXXXXX-X. These properties stopped collecting new data on July 1, 2023.
  • New Google Analytics 4 Measurement ID: Follows the format G-XXXXXXXXXX. This is the new standard and what you'll be using moving forward.

So when you hear "Tracking ID," today that almost always means the GA4 "Measurement ID." Let's walk through how to create a new one from scratch.

How to Create a New Google Analytics 4 Measurement ID

If you're starting fresh without any Google Analytics account, follow these steps. This process will create a new account, a property for your website, a data stream to collect information, and finally, give you the Measurement ID you need.

Step 1: Get Started with Google Analytics

First, head over to the Google Analytics website. You'll need to sign in with a Google account. It's best practice to use a Google account that you plan to manage your business with for the long term.

Once you sign in, click the "Start measuring" button to begin the setup process.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Step 2: Create Your Account

The first screen asks you to create an "Account." An account is the highest level of organization in Google Analytics. Typically, a single business or company will have one account, which can then contain multiple "properties" (like one property for your main website, another for a mobile app, etc.).

Enter a name for your account. This is usually your business name (e.g., "Mandy's Donut Shop").

Below the account name, you’ll see some "Account Data Sharing Settings." These settings control how your data is shared with Google for things like technical support and product improvement. Review and check the boxes you’re comfortable with, then click Next.

Step 3: Create a Property

A "Property" represents a specific website or app that you want to track. As mentioned, one account can have multiple properties. For example, if your business had a website and an Android app, you'd create two separate properties under the same account.

  • Property name: Name your property clearly. "Main Company Website" is a good, descriptive choice.
  • Reporting time zone: Select the time zone your business operates in. This ensures that your daily reports align with your business day (e.g., reporting that a day ends at midnight in your local time).
  • Currency: Choose the currency you operate in. This is especially important if you have an e-commerce site, as it will be used for revenue reporting.

After filling this out, click Next.

Step 4: Provide Your Business Details

Google asks for a bit more information to help tailor your experience and provide relevant benchmarking data. Select your industry category, business size, and how you intend to use Google Analytics. This doesn't permanently change anything, so just choose the options that best fit your goals.

Click Create and be ready to accept the Google Analytics Terms of Service Agreement. You'll need to check the box and click "I Accept."

Step 5: Set Up a Web Data Stream

Once you accept the terms, you'll be prompted to set up your first "Data Stream." A Data Stream is the source from which data flows into your GA4 property.

You’ll see three choices: Web, Android app, or iOS app. Since we are setting this up for a website, choose Web.

A new window will appear asking for two things:

  • Your website's URL: Enter the main URL of your website (e.g., www.mandysdonutshop.com). Make sure you have the correct https:// prefix selected.
  • Stream name: Give it a descriptive name, like "Main Website Stream."

You will also see a section for "Enhanced measurement." This should be enabled by default. Leave it on! Enhanced measurement automatically tracks important interactions like outbound clicks, scrolls, file downloads, and video engagement, saving you a ton of manual setup work.

Finally, click Create stream.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Step 6: Find Your Measurement ID

Congratulations! As soon as you create the stream, you'll land on the "Web stream details" page. In the top right corner, you will see your Measurement ID, a code that starts with "G-" (e.g., G-1ABCDE2F3G).

This G- code is the new Google Analytics "Tracking ID" you need to install on your website.

How to Find Your Existing GA4 Measurement ID

What if you’ve already gone through the setup process but can't remember where to find your Measurement ID? Don't worry, it's easy to locate.

  1. Log into your Google Analytics account.
  2. Click the Admin gear icon in the bottom-left corner.
  3. In the "Account" column on the left, make sure your correct account is selected.
  4. In the "Property" column next to it, make sure the correct GA4 property is selected.
  5. Under the "Property" column, find and click on Data Streams.
  6. You'll see a list of your data streams. Click on the web stream associated with your website.
  7. The "Web stream details" page will open, and you'll find your Measurement ID (the G- code) at the top right of the page.

How Do I Add the Measurement ID to My Website?

Now that you have your Measurement ID, the final step is to put it on your website so it can start collecting data. You generally have three options for this.

Option 1: The Do-It-Yourself Way (gtag.js)

On that same "Web stream details" page, under "Installation instructions," you'll see an "Install manually" tab. This tab contains a block of JavaScript code called the Google tag (or gtag.js). It will look something like this, but with your unique G- ID:

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

You need to add this code to the <head> section of every page on your website. If you're comfortable editing your site's HTML, you can copy this snippet and paste it immediately after the opening <head> tag on every page you want to track.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Option 2: Using a Website Platform Integration

This is the easiest method for most people. Many popular website builders and e-commerce platforms like WordPress, Shopify, Wix, and Squarespace have a built-in integration for Google Analytics.

Simply navigate to your platform’s settings or integrations area and look for a field labeled "Google Analytics ID" or "Google Analytics Measurement ID." All you have to do is copy your G- Measurement ID and paste it into that field. The platform handles putting the code on every page for you.

Option 3: The Scalable Way (Google Tag Manager)

Google Tag Manager (GTM) is a free tool that allows you to manage and deploy marketing tags (like your GA4 tag) without having to modify your site's code every time. It’s slightly more advanced to set up initially, but it’s the most flexible and powerful long-term solution.

If you're using GTM, you’ll just need to create a new "GA4 Configuration" tag inside GTM, paste your Measurement ID into the tag, and set it to fire on all pages.

Final Thoughts

Acquiring and installing your Google Analytics ID is the foundational step toward making data-driven decisions. The new GA4 framework uses a "Measurement ID" (G-) which you can find by creating an account, a property, and a web data stream. Once you have it, simply add it to your website via your platform's integration or by pasting in the Google tag manually.

Getting your tracking set up is just the beginning. The next and more challenging step is turning that raw data into clear, actionable insights for your business. The new GA4 interface can be complex to navigate, making it tough to quickly find the answers you need. At Graphed, we simplify this by connecting directly to your Google Analytics account. Rather than getting lost in predefined reports, you can ask questions in natural language like, "Which campaigns drove the most new users last month?" and instantly get real-time dashboards and answers, freeing you to focus on strategy instead of struggling with tools.

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!