How to Install Tracking ID in Google Analytics

Cody Schneider8 min read

Putting a Google Analytics tracking code on your website is the first real step toward understanding who your visitors are and how they behave. This unique ID is what tells Google Analytics to connect your website's traffic data to your specific account. This article will show you exactly how to find your Google Analytics ID and the best ways to get it installed on your site.

GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

What is a Google Analytics Tracking ID? (And Why You Need It)

Think of the Google Analytics tracking ID as your website's unique mailing address for data. When a user lands on your site, a small piece of JavaScript code (called the Global Site Tag or gtag.js) sends a packet of information - like what page they're on, their device type, and where they came from - to Google's servers. The tracking ID in that code ensures that data packet arrives at the correct Google Analytics account: yours.

Without this ID on every page of your site, Google Analytics simply won't see any of your traffic. It's the foundational connection that makes all of your website reporting possible.

From Universal Analytics (UA) to Google Analytics 4

For many years, the standard tracking ID was the Universal Analytics (UA) ID, which looked like this: UA-12345678-1. However, Google has shifted completely to its newer platform, Google Analytics 4.

If you're creating a new Google Analytics account today, you will only receive a GA4 ID. This ID is called a "Measurement ID" and has a different format: G-XXXXXXXXXX.

The core purpose is a little different too. While the UA code was built primarily for tracking website pageviews, the GA4 model is built around tracking "events" - a more flexible way to measure user interactions like clicks, video plays, and form submissions across both websites and mobile apps. All the steps in this guide will focus on installing the modern GA4 Measurement ID.

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Step-by-Step Guide: How to Find Your GA4 Measurement ID

First things first, you need to find this "G-" ID inside your Google Analytics account. The good news is that it's always in the same place.

Here’s how to locate it in just a few clicks:

  1. Sign In to Google Analytics: Head to analytics.google.com and sign in. If you don't have an account yet, you'll be prompted to create one.
  2. Go to the Admin Section: In the bottom-left corner of the screen, you’ll see a gear icon labeled "Admin." Click on it to open the administrative settings.
  3. Confirm Your Account and Property: The Admin page has three columns: Account, Property, and (on the older UA platform) View. Make sure the correct Account and Property are selected at the top of their respective columns. For most small businesses, you'll only have one of each.
  4. Click on "Data Streams": In the second column ("Property"), find and click on "Data Streams." This is where Google Analytics manages the sources of data flowing into your property, like your website or a mobile app.
  5. Select Your Web Data Stream: You'll see a list of your data streams. Click on the one that corresponds to your website. It will typically be named after your website's URL.
  6. Find and Copy Your Measurement ID: A new panel will open with details about your web stream. Your Measurement ID (starting with "G-") will be clearly displayed in the top right corner. Click the copy icon next to it to copy the ID to your clipboard.

That’s it! You now have the unique ID you need to connect your website to Google Analytics.

3 Ways to Install Your Google Analytics Tracking ID

Now that you have your Measurement ID, it's time to add it to your website. There are three primary methods to do this, ranging from incredibly simple to slightly more technical. Choose the one that best fits your website platform and comfort level.

Method 1: Using a CMS or Platform Integration (Easiest Way)

Most modern website builders and Content Management Systems (CMS) like WordPress, Shopify, and Squarespace have a built-in feature to add your Google Analytics ID. This is by far the easiest method for non-technical users, as it doesn't require touching any code.

For WordPress Users:

The easiest way to add your tracking code to a WordPress site is by using a plugin. Here are two popular options:

  • Site Kit by Google: Google's official plugin for WordPress simplifies connecting your site to an array of Google services, including Analytics. Just install the plugin, follow the on-screen setup wizard to connect your Google account, and Site Kit will automatically place the tracking code for you.
  • MonsterInsights: A third-party plugin dedicated to making Analytics easy for WordPress. The setup process is similar: install a plugin, connect your Google account, and it handles the rest.

Many WordPress themes also include a dedicated field in the "Theme Options" or "Customize" settings where you can directly paste your "G-" Measurement ID.

For Shopify Users:

Shopify makes this process incredibly simple. You don't need a plugin or any code.

  1. In your Shopify Admin, go to Online Store > Preferences.
  2. Find the "Google Analytics" section.
  3. In the "Google Analytics account" box, paste your entire G-XXXXXXXXXX Measurement ID.
  4. Click Save.

For Wix or Squarespace Users:

These platforms also have straightforward, no-code integrations:

  • Wix: Go to Marketing & SEO > Marketing Integrations. Under Google Analytics, click "Connect" and paste your Measurement ID.
  • Squarespace: Go to Settings > Advanced > External API Keys. In the "Google Analytics" field, paste your Measurement ID.
GraphedGraphed

Your AI Data Analyst to Create Live Dashboards

Connect your data sources and let AI build beautiful, real-time dashboards for you in seconds.

Watch Graphed demo video

Method 2: Using Google Tag Manager (Most Flexible & Powerful)

Google Tag Manager (GTM) is the recommended method for anyone who plans to add more than just Google Analytics to their site in the future (like a Facebook Pixel or LinkedIn Insight Tag). GTM acts as a "container" for all your tracking snippets, so you only have to put one piece of code on your site (the GTM code) and can manage everything else from the GTM interface.

Prerequisite: This assumes you've already created a GTM account and installed the GTM container snippet on your website. If you haven't, do that first.

  1. Create a New Tag: Inside your GTM container, go to "Tags" and click "New."
  2. Configure Your Tag:
  3. Add Your Measurement ID: In the "Measurement ID" field that appears, paste your "G-" ID that you copied earlier.
  4. Set Your Trigger: Click the "Triggering" box below. A trigger tells GTM when to fire your tag. Choose the "All Pages" trigger to have Google Analytics track every pageview on your site.
  5. Save and Publish: Click "Save" in the top right. Then, don't forget the most important step: click "Submit" and then "Publish" to make your changes live on your website.

Method 3: Direct Manual Installation (For Custom Websites)

If you're using a custom-built website without a CMS or you prefer to do things manually, you can add the entire tracking snippet directly into your website's HTML code.

  1. Find Your Global Site Tag (gtag.js) Snippet: Return to the same "Web stream details" page in Google Analytics where you found your Measurement ID. Below, look for a section called "View tag instructions" or "Tagging instructions." This will reveal the full JavaScript snippet.
  2. Copy the Snippet: It will look something like this code block here. Copy the entire thing.
<!-- 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>
  1. Paste the Snippet into Your Site's <head> Section: Open the HTML files for your website. You need to paste this entire snippet immediately after the opening <head> tag. It's crucial to add it to every single page you want to track. Many site frameworks have a universal "header" or "template" file you can edit once to apply this globally.
*Note: If you are using this method, do not also use a plugin or Google Tag Manager for the same GA4 property, as this will cause data to be collected and sent twice, skewing your metrics.*

Free PDF Guide

AI for Data Analysis Crash Course

Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.

Quick Tip: How to Verify Your Tracking is Working

After you've installed your ID, don’t just assume it’s working. Always verify it. The easiest way is to use Google Analytics' own Realtime report.

  1. Keep your Google Analytics account open in one browser tab. Navigate to Reports > Realtime.
  2. In a different browser tab or on your phone, visit your own website.
  3. Switch back to the Realtime report tab in GA. In a few seconds, you should see yourself appear as at least one active user.

If you see your activity populate the report, congratulations! You have successfully installed Google Analytics on your website and are officially collecting data.

Final Thoughts

Getting your Google Analytics Measurement ID installed correctly is the necessary first step to collecting valuable data about your website's traffic. It's the key that unlocks all the insights you need to understand user behavior, measure marketing campaign success, and ultimately make smarter, data-driven decisions to grow your business.

Once data starts flowing, the next challenge is quickly turning those numbers into clear, understandable insights without getting lost in complex reports. We built Graphed to solve exactly this problem. Instead of wrestling with complex dashboards, you can connect your Google Analytics account and simply ask questions in plain English, like "Show me my top traffic sources this month as a bar chart" or "Compare revenue from organic search versus paid ads." Our platform builds live, interactive dashboards for you in seconds, saving you hours of manual reporting work and helping your whole team get the answers they need to move forward.

Related Articles