How to Set Up Google Analytics

Cody Schneider9 min read

Setting up Google Analytics is one of the most important first steps you can take for your new website or business. It's the key to understanding who your visitors are, where they come from, and what they do on your site. This guide will walk you through the entire process, step-by-step, from creating your account to ensuring your website is successfully sending data.

Why You Need Google Analytics in the First Place

Before jumping into the setup, it's worth a quick reminder of what you get with Google Analytics. This free tool helps you answer fundamental questions about your business, such as:

  • How many people are visiting my website? See daily, weekly, and monthly trends.
  • Where are my visitors coming from? Are they finding you through Google search, social media, or other websites?
  • What content is most popular? Find out which blog posts, pages, and products get the most engagement.
  • Is my marketing working? Track whether your Google Ads, Facebook campaigns, or email newsletters are actually driving traffic and sales.

Without this data, you're essentially flying blind. Google Analytics gives you the insights to make better decisions about your marketing, content, and overall website strategy.

Getting Familiar with the New GA4 Structure

Google has moved everyone to Google Analytics 4, which has a slightly different structure than its predecessor, Universal Analytics. Understanding this hierarchy will make the setup process much clearer.

It’s organized into three levels:

  1. Account: This is the highest level, typically representing your company or organization. You'll have one account that contains all your digital properties.
  2. Property: A property represents a specific website or app that you want to track. If your business has a website and a mobile app, you would create two separate properties under the same account.
  3. Data Stream: This is the source of data flowing into your property. For a website, you will create a “Web” data stream. For an iOS app, you’d create an “iOS” data stream. This is where you'll find the measurement ID or tracking code you need to put on your site.

Think of it like a filing cabinet: the Account is the entire cabinet, a Property is a drawer for a specific project (like your website), and the Data Stream is the individual folder inside that drawer collecting all the relevant papers (your website visitor data).

How to Create Your Google Analytics Account and Property

Now, let’s get it set up. The process only takes a few minutes if you follow these steps.

Step 1: Go to the Google Analytics Website

To begin, head over to the Google Analytics website. You’ll need a Google account to proceed. If you’re already logged into a Gmail account, it will automatically use that one. If not, you’ll be prompted to log in or create a new one.

Once you're in, click the "Start measuring" button.

Step 2: Create a New Account

First, you’ll be prompted to create your account. This part is simple.

  • Account name: Enter your business or organization's name here. Something like “My Awesome Company” is perfect.

Below the account name, you'll see "Account Data Sharing Settings." These options control how your data can be shared with Google for things like technical support and benchmarking. You can review them and check the boxes you're comfortable with. For most users, the default settings are fine. Click "Next."

Step 3: Create a New Property

Next up is the Property level. This is where you define the specific website you want to track.

  • Property name: Enter the name of your website. Using your domain name, like www.yourwebsite.com, is common best practice.
  • Reporting time zone: Select the time zone you operate in. This is crucial, as it ensures your daily reports align with your actual business days.
  • Currency: Choose your primary business currency. This is essential if you plan to track e-commerce revenue or ad spend.

Click "Next" to continue.

Step 4: Answer the Business Details Questions

Google will now ask a few questions about your business, such as industry category and business size. GA4 uses this information to provide industry-specific benchmarks and tailor your reporting experience over time. Simply choose the options that best describe your company.

On the next screen, you’ll be asked to choose how you intend to use Google Analytics. Check the boxes that align with your goals, like "Measure customer engagement" or "Optimize my advertising cost."

Once you’re done, click "Create."

Step 5: Accept the Terms of Service

A pop-up will appear with the Google Analytics Terms of Service Agreement. You'll need to select your country, check the box to accept the terms, and click "I Accept."

Connecting Your Website: Setting Up Your Data Stream

After you accept the terms, you'll be taken directly to the page to set up your first data stream. This is the final step in the GA4 setup process, which generates the tracking tag for your site.

Step 1: Choose Your Platform

You’ll be asked to choose a platform to start collecting data from. Your options are Web, Android App, or iOS App. Since you're setting this up for a website, click on "Web."

Step 2: Enter Your Website Details

A new panel will slide out where you need to enter your website's URL and give the stream a name.

  • Website URL: Enter your domain exactly as it appears in the browser, making sure to select http:// or https:// correctly.
  • Stream name: This can be the same as your website name. It’s just an internal label.

You'll also see a section called Enhanced measurement. This is automatically toggled on, which is great. It allows GA4 to automatically track common interactions like page views, scrolls, outbound link clicks, and file downloads without any extra configuration. Leave this enabled.

Click "Create stream."

Step 3: Finding Your Measurement ID and Global Site Tag

Congratulations! You’ve created your data stream. You'll now be taken to a page with all the details you need to put Google Analytics on your actual website. You’ll see two key pieces of information:

  • Measurement ID: This is a unique identifier for your data stream that looks like G-XXXXXXXXXX. This is what you'll use for most non-code website integrations (like WordPress plugins or Shopify settings).
  • Global Site Tag (gtag.js): This is a snippet of JavaScript code. You’ll need this full snippet if you plan to install GA by editing your website's code directly.
<!-- Global site tag (gtag.js) - Google Analytics -->
<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>

Installing the Google Tag on Your Website

Now all that’s left is to connect your site to GA4 using the ID or tag you just got. There are a few ways to do this, ranging from super simple to a bit more technical.

Option 1: Using a Website Builder or CMS Integration (The Easy Way)

Most popular platforms have a built-in field where you can just paste your Measurement ID. This is the simplest method and requires no code at all.

  • WordPress: Use a plugin like Site Kit by Google or MonsterInsights. Once installed, it will guide you through connecting your account, or you can find a field in its settings to paste your G-ID.
  • Shopify: Go to your Shopify admin > Online Store > Preferences. There is a section for Google Analytics where you can paste your Measurement ID.
  • Squarespace: Go to Settings > Advanced > External API Keys. Paste your Measurement ID into the Google Analytics field.
  • Wix: Go to Marketing & SEO > Marketing Integrations. Under Google Analytics, click Connect and follow the prompts to add your ID.

Option 2: Using Google Tag Manager (The Best Way for Marketers)

Google Tag Manager (GTM) is a powerful tool that acts as a container for all your marketing and analytics tags. If you plan on adding other tags (like a Facebook Pixel or Google Ads tag) later, it's best to start with GTM.

The process is straightforward:

  1. Create a Google Tag Manager account and add the GTM container code to your website.
  2. Inside GTM, go to "Tags" and click "New."
  3. Give your tag a name (e.g., "GA4 Config Tag").
  4. Click "Tag Configuration" and choose Google Analytics: GA4 Configuration.
  5. In the "Measurement ID" field, paste your G-ID.
  6. Click "Triggering" and select All Pages.
  7. Save the tag, then click the "Submit" and "Publish" buttons in the top right corner.

Option 3: Manually Adding the Code to Your Site’s Header (The Developer Way)

This method involves editing your website’s code directly. If you're not comfortable with HTML, it’s safer to stick with the methods above. To do it manually, copy the entire Global Site Tag (gtag.js) snippet. Then, paste it into the <head> section of every page on your website. If you are using a template or theme, you can often add this to a single theme header file.

How to Check if Google Analytics is Working

After you’ve installed the tag, you’ll want to confirm it’s working. The easiest way is with the Realtime report.

  1. Log into your Google Analytics account and navigate to Reports > Realtime.
  2. In a new browser tab or on your phone, open your website.
  3. Go back to the GA4 Realtime report. Within a minute or two, you should see at least "1" appear in the "Users in last 30 minutes" card.

And that’s it! You've successfully installed Google Analytics 4. It can take 24-48 hours for regular reports to start populating with data, so be patient. From here on out, you'll be collecting valuable data that you can use to grow your online presence.

Final Thoughts

Now that you've set up Google Analytics on your site, you have a solid foundation for data-driven decision-making. You can start tracking your key metrics to understand visitor behavior and see which of your marketing efforts are paying off.

While GA is an amazing tool for collecting information, its native reports can sometimes be complex and time-consuming to navigate. That’s actually a big part of why we built Graphed. We connect directly to your Google Analytics account — and your other apps like Google Ads or Shopify — so you can use simple natural language to ask questions and build dashboards in seconds. It allows you to get straight to insights without getting lost in the reports.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.