How to Change Tracking ID in Google Analytics

Cody Schneider10 min read

Thinking you can simply change your existing Tracking ID in Google Analytics is a common point of confusion. The reality is that your Tracking ID or Measurement ID is permanently assigned to a specific property and can't be edited. "Changing" it actually means creating an entirely new Google Analytics property and replacing the old tracking code on your website with the new one. This article will guide you through that exact process, from understanding the IDs to implementing the new code and verifying it works.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Tracking ID vs. Measurement ID: A Quick Primer

Before diving into the "how," it's important to understand the different IDs used by Google Analytics. The type of ID you have tells you which version of Google Analytics you're using, and since July 2023, this distinction has become critical.

Universal Analytics (UA) Tracking ID

Universal Analytics was the standard for years, and its properties are identified by a Tracking ID. This ID follows a specific format: UA-XXXXXXXX-Y.

  • UA: Stands for Universal Analytics.
  • XXXXXXXX: Your unique account number.
  • Y: The specific property number within your account.

If you're still seeing a UA- ID on your website, it's a clear sign that you need to take action. As of July 1, 2023, Universal Analytics properties have stopped processing new data. Any old code with a UA- ID is essentially just collecting virtual dust.

Google Analytics 4 Measurement ID

Google Analytics 4 is the current generation and is a complete shift in how data is collected and analyzed. GA4 uses a Measurement ID, which has a different format: G-XXXXXXXXXX.

This "G-" ID is linked to something GA4 calls a "data stream." A data stream is simply a source of data flowing into your property, which for most people is their website. When someone asks how to change their tracking ID today, what they almost always need to do is migrate from the old UA system to GA4 by setting up a new property and implementing its new "G-" Measurement ID.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

When and Why Create a New GA4 Property?

Why go through the trouble of setting up a new property? There are several key scenarios where this is not just recommended, but necessary.

  • Mandatory Migration to GA4: This is the number one reason. If you were using Universal Analytics, you have no choice but to create a new GA4 property to continue tracking your website's performance. The old UA system is obsolete for new data.
  • Starting With a Clean Slate: Sometimes your historical data is a mess. It might be polluted with internal traffic from your team, skewed by improper filter configurations, or tracked inconsistently over the years. Creating a new property gives you a fresh, clean start, ensuring your new dataset is accurate from day one.
  • Separating Business Units or Websites: If your company splits a large website into multiple distinct sites or sells a part of its business, you'll want to create separate GA4 properties for each. This keeps data clean and prevents the performance of one site from co-mingling with another, providing clearer insights for each entity.
  • Losing Access to Your Old Account: It happens more than you'd think. An employee or agency that set up the original account leaves without transferring ownership, locking you out. In this unfortunate case, your only option is to create a new GA account and property from scratch.

For most users, the first point is the driver. The rest of this guide will treat this process as a migration from an old system to the modern GA4 standard.

Step-by-Step: Creating a New GA4 Property and Getting Your Measurement ID

Ready to get your new Measurement ID? You’ll need "Editor" level permissions on the Google Analytics account. If you have that, follow these steps.

1. Navigate to the Admin Panel

Log in to your Google Analytics account. In the bottom-left corner of the screen, you’ll see a gear icon labeled "Admin." Click on it to access the settings panel.

2. Create a New Property

The Admin screen is typically divided into two columns: "Account" and "Property." In the "Property" column, click the blue button that says + Create Property. Even if you see old UA properties listed, we are creating a brand new one from scratch.

3. Enter Your Property Details

This is the first setup screen for your new property.

  • Property name: Give your property a clear, descriptive name. For example, "My Business Website - GA4".
  • Reporting time zone: Select the time zone your business operates in. This ensures that your daily reports align with your business day.
  • Currency: Choose the primary currency you use for transactions. This is crucial for accurate e-commerce reporting.

Once filled out, click Next.

4. Provide Business Information

Google asks for some basic details about your business to tailor your experience. Select your industry category, business size, and then click Next. While optional, filling this out can help Google provide more relevant benchmarks and feature suggestions.

5. Choose Your Business Objectives

Here, you tell Google what you want to accomplish with Analytics. Are you trying to generate leads? Drive online sales? Build brand awareness? Check the boxes that best align with your goals. This configuration helps GA4 customize the reports that are automatically set up for you. Most people should at least select "Examine user behavior." Click Create when you're done.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

6. Set Up a Data Stream

With the property created, GA wants to know where it should get its data from. You'll be prompted to "Choose a platform." For a website, click on Web.

Now you'll configure your web data stream:

  • Website URL: Enter your website’s homepage address (e.g., www.mybusiness.com). Make sure you select either http:// or https:// correctly.
  • Stream name: Give the stream a logical name, like "[Your Brand] Website Stream."

7. Find Your New Measurement ID

Leave the "Enhanced measurement" option turned on, as it automatically tracks key user interactions like page views, scrolls, outbound clicks, and file downloads. Click Create stream.

You'll now see a "Web stream details" page. In the top right corner, you will see your brand new Measurement ID (e.g., G-XYZ123ABC). This is the ID you need for the next phase. Copy it and keep it handy.

How to Implement Your New GA4 Tracking Code

Creating the property is only half the battle. Your new Measurement ID won’t track anything until its associated code is correctly installed on your website. Just as importantly, you must remove your old Universal Analytics code snippet. Having both installed at the same time can lead to tracking issues and inaccurate data.

Here are the three most common ways to get the new code on your site.

Method 1: Google Tag Manager (Recommended)

Using Google Tag Manager (GTM) is the most flexible and robust way to manage your tracking codes. It keeps all your different codes (for analytics, ads, etc.) in one container and lets you deploy them without having to edit your website's code directly.

  1. Log in to GTM: Navigate to your GTM account and workspace.
  2. Remove the Old Tag: Find your old Universal Analytics tag. It will likely be named "UA Pageview" or something similar. Click on it and use the triple-dot menu in the corner to Pause or Delete it. Pausing is safer if you want a backup.
  3. Create a New Tag: Go to Tags > New. Give it a descriptive name like "GA4 Configuration - [Your Site Name]".
  4. Configure the Tag: Click "Tag Configuration" and choose Google Analytics: GA4 Configuration from the list.
  5. Paste Your ID: In the "Measurement ID" field, paste the G-XXXXXXXXXX ID you copied earlier.
  6. Set the Trigger: Click on the "Triggering" section below and select the All Pages trigger. This tells GTM to fire the GA4 tag on every page load.
  7. Save and Publish: Save the tag. Then, use the "Preview" mode to test that the new tag is firing correctly on your live site. Once confirmed, click the "Submit" button in GTM to publish your changes.
GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Method 2: Add the Global Site Tag (gtag.js) to Your Website Code

If you don't use GTM, you can place the tracking code directly into your website's HTML.

  1. Find the Code Snippet: In your GA4 Web stream details page (where you found your Measurement ID), look for the "Install manually" tab. Copy the entire JavaScript code block provided there.
  2. Remove the Old Code: Find and delete the old Universal Analytics (UA) code from your website template files. It's also a gtag.js or analytics.js snippet but will reference your old UA-XXXXXXXX-Y ID.
  3. Paste the New Code: Paste the new GA4 code snippet immediately after the opening <head> tag on every page of your website. If you are using a content management system like WordPress, this often means editing a file called header.php in your theme editor.
<!-- 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>

Method 3: Platform Integration or Plugin (WordPress, Shopify, etc.)

Many popular platforms have built-in fields or recommend specific plugins to make this easy.

  • WordPress: You can use a dedicated plugin like SiteKit by Google, MonsterInsights, or manually insert the Measurement ID into your theme's settings if it provides an integration option. Just find the field asking for your Google Analytics ID, remove the old UA- ID, and paste in your new G- ID.
  • Shopify: Navigate to Online Store > Preferences. In the Google Analytics section, you can add the tag directly. Shopify recommends using its Google & YouTube app for the most seamless integration. As always, ensure any old UA- ID is removed first.

Verify That Your New ID Is Working

After installation, the final step is to make sure your website is actually sending data to your new property.

The easiest way is to use the Realtime report in GA4. Here's how:

  1. Go to your new GA4 property in Google Analytics.
  2. In the left-hand navigation, click on Reports > Realtime.
  3. Open a new browser tab (preferably an incognito window to avoid being filtered) and visit your own website. Click around a few pages.
  4. Switch back to the Realtime report. Within a minute or two, you should see at least "1" appear in the "Users in Last 30 Minutes" card.

If your visit shows up, congratulations! You have successfully changed your tracking ID and are now collecting data with Google Analytics 4.

Final Thoughts

Switching your Google Analytics tracking ID boils down to creating a new GA4 property, grabbing its unique Measurement ID, and updating your website's code to use it instead of the old one. The most important step in this entire process is remembering to remove the old Universal Analytics tag to ensure your data collection going forward is clean and accurate.

Once you’ve successfully connected data sources like Google Analytics, the challenge shifts to extracting meaningful insights from all that data. The standard reports are a start, but answering specific business questions often requires a lot of manual digging. With our platform, Graphed, we remove that friction. You connect your data sources like GA4 one time, and from then on, you can ask for reports and dashboards in plain English. Instead of learning a complex new interface, just ask, "Show me my top 10 landing pages by sessions and conversions last month," and get a live, automated report in seconds.

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!