How to Set Up Google Analytics on a New Site

Cody Schneider

Got a new website? Setting up Google Analytics should be your first task after making it live. Without it, you’re flying blind, relying on gut feelings instead of real data to understand how people find and use your site. This guide walks you through the step-by-step process of creating a Google Analytics 4 account, getting your tracking code, and adding it to your website so you can start measuring traffic right away.

What is Google Analytics and Why Do You Need It?

Before we jump into the setup, let's quickly cover what Google Analytics actually does. It's a free web analytics service that tracks and reports website traffic. It answers fundamental questions that are impossible to know otherwise:

  • How many people are visiting my site? See an accurate count of sessions and users over any time period.

  • Where do my visitors come from? Learn if your traffic is coming from Google search, social media, ads, or direct links.

  • Which pages are the most popular? Find out what content resonates most with your audience.

  • Are my marketing campaigns working? Measure which channels are actually driving traffic and conversions.

Knowing this information helps you make smarter decisions about your marketing, content, and website design. It’s an essential tool, and setting it up is easier than you think.

Step 1: Create Your Google Analytics 4 Account

Your journey begins at the Google Analytics website. You’ll need a Google account to get started. If you already use Gmail or Google Workspace, you’re all set.

Create a New Account

  1. Navigate to the Google Analytics homepage and sign in with your Google account.

  2. If this is your first time, you'll see a welcome screen. Click the blue "Start measuring" button.

  3. On the Account setup screen, give your account a name. A simple best practice here is to use your business name.

  4. Review the Account Data Sharing Settings. These options allow you to share anonymous data with Google to help improve their products. It's safe to leave these checked, or you can uncheck them if you prefer. Click "Next" when you’re ready.

Create a Property

Next up is creating a "property." Think of a property as the home for all the data from a single website or app.

  1. On the Property setup page, enter your website’s name in the Property name field.

  2. Select the correct Reporting time zone and Currency. This is important for accuracy, especially if you run an e-commerce store. People often forget this and end up with reports that don't align with their business day.

  3. Click "Next."

Provide Your Business Details

Google asks a few simple questions about your company. This helps them provide benchmark data so you can see how you stack up against others in your industry.

  1. Select your Industry category and Business size from the dropdown menus.

  2. Choose how you intend to use Google Analytics. Most new users should select "Examine user behavior" or "Get baseline reports" to keep things simple. This choice helps tailor the navigation and reports you see initially.

  3. Click "Create" and accept the Google Analytics Terms of Service when the pop-up appears.

Step 2: Set Up Your Data Stream

Once you accept the terms, you’ll be prompted to set up a "data stream." A data stream is simply the source of your data. In most cases, this will be your website.

  1. Choose your platform. Since you’re setting this up for a new website, click "Web."

  2. Next, enter your website's URL (e.g., https://www.yourwebsitename.com) and give the stream a name (your website name works perfectly here).

  3. Make sure "Enhanced measurement" is checked. This is one of GA4’s best features - it automatically tracks standard user interactions like page views, scrolls, outbound clicks, and file downloads without you having to configure anything extra.

  4. Click "Create stream."

After clicking, you'll see a page titled Web stream details. This page is super important as it contains the tracking information you need to add to your site. You’ll see your Measurement ID at the top right, which looks like G-XXXXXXXXXX.

Step 3: Add the Tracking Code to Your Website

This is where things can feel a bit technical, but modern website platforms have made it incredibly simple. There are two main ways to get the job done: using a built-in integration on your site builder or manually adding the code snippet.

Option A: Use an automatic integration (The Easy Way)

Most popular platforms like WordPress, Shopify, Squarespace, and Wix have simple tools that let you install Google Analytics just by pasting in your Measurement ID.

For WordPress Users

The easiest way to get Google Analytics running on a WordPress site is with a plugin. This method prevents your tracking code from being erased when you update your theme.

  • Site Kit by Google: This is Google’s official plugin. Go to your WordPress admin dashboard, navigate to Plugins > Add New, and search for "Site Kit by Google." Install and activate it, then follow the setup prompts to connect your Google account. It automatically finds your Analytics property and adds the code for you.

  • Manual via Theme/Plugin: Some themes or SEO plugins (like All in One SEO or Rank Math) have a specific field in their settings where you can just paste your Measurement ID. This is often the quickest path if you already use one of those tools.

For Shopify Users

Shopify makes this process about as easy as it gets.

  1. From your Shopify Admin dashboard, go to Online Store > Preferences.

  2. Find the "Google Analytics" section.

  3. Go back to your Google Analytics Web stream details page and look for the tab that says "Install manually." Copy the entire Global Site Tag code snippet provided.

  4. Paste that entire code snippet into the “Google Analytics” box in your Shopify preferences and click "Save."

For Squarespace, Wix, or Other Builders

Most modern website builders have a designated spot for web analytics.

  • Squarespace: Go to Settings > Advanced > External API Keys and paste your Measurement ID into the "Google Analytics" field.

  • Wix: Go to Marketing & SEO > Marketing Integrations, find the Google Analytics box, click "Connect," and follow the instructions to connect with your Google account.

If you're using a different platform, search their help documentation for "Google Analytics." They'll almost always have a simple guide for you.

Option B: Add the code manually to your website’s HTML

If you're not using a platform with an easy built-in solution or feel comfortable editing your website's code, you can install the tracking manually. You’ll need the full Global Site Tag (gtag.js) snippet, not just the Measurement ID.

  1. Navigate to your Google Analytics Web stream details page and view the installation instructions. Under the "View tag instructions,” select the "Install manually" tab.

  2. Copy the entire code snippet displayed in the box.

  3. Paste this snippet into the <head> section of your website’s HTML. It must be added to every single page you want to track. If your site uses a template file like header.php or a similar include, place it there so it deploys across your entire site automatically.

Note: Be careful when editing code directly. Creating a backup before you make changes is always a good idea.

Step 4: Verify That Your Setup Is Working

Once you’ve added the code, you need to make sure Google is actually receiving data from your site. Don't worry, you don't have to wait 24 hours to find out.

  1. Go back to your Google Analytics dashboard.

  2. In the left-hand menu, navigate to Reports > Realtime. The Realtime report shows you visitors who are on your site right now.

  3. Open your website in a separate browser tab or on your phone. Make sure you're not logged into your website's admin panel if it blocks tracking for administrators.

  4. Head back to the Realtime report. Within about 30-60 seconds, you should see the number of users update from 0 to 1. Congratulations, that's you!

If you see your visit, you've done everything correctly. Regular reports can take 24-48 hours to start populating with data, but the Realtime view confirms your connection is active.

Final Thoughts

Setting it up puts you in a powerful position to understand what’s working and what isn’t, allowing you to move beyond assumptions and start making data-driven improvements to grow your business.

Once you start collecting data, the next step is turning it into meaningful insights. Seeing all those numbers and reports in Google Analytics can be a bit overwhelming. At Graphed, we connect directly to your Google Analytics and other tools like Shopify or Facebook Ads, letting you create dashboards and ask questions about your data in simple, natural language. Instead of clicking through dozens of reports to find an answer, you can just ask, "Which marketing channel had the best ROI last month?" and get an instant visualization.