How to Add a Website to Google Analytics
Want to understand who visits your website and what they do? Adding Google Analytics is the essential first step. It's a free, powerful tool that unlocks critical insights about your audience and their behavior. This guide will walk you through creating an account, installing the code, and verifying that everything is working correctly.
What is Google Analytics and Why Do You Actually Need It?
Google Analytics (GA) is a free web analytics service that tracks and reports website traffic. Think of it as the ultimate dashboard for your website's performance. Instead of guessing who your visitors are or what content they like, you get hard data to back up your decisions.
Once it's set up, Google Analytics can answer crucial questions like:
- Who is my audience? See where your visitors live, what language they speak, and what devices they use (desktop, mobile, tablet).
- How do people find my site? Discover if your traffic is coming from Google search (organic), social media, paid ads, or direct links.
- What pages are most popular? Learn which blog posts, products, or service pages get the most attention from your visitors.
- Are my marketing efforts working? Track whether your email campaigns, Facebook Ads, or SEO strategies are actually driving traffic and engagement.
- Why do visitors leave? Understand which pages might be causing visitors to lose interest and "bounce" away from your site.
Without this data, you’re flying blind. With it, you can double down on what works, fix what doesn’t, and make smarter decisions to grow your business.
Before You Start: What You'll Need
The process is straightforward, but you'll need two things ready before you begin:
- A Google Account: You need a standard Google account to use Google Analytics. If you have Gmail or use Google Workspace, you’re all set. If not, you can create one for free.
- Admin Access to Your Website: You'll need to add a small snippet of code to your website. This is simple on most platforms, but it requires you to have administrative access to your site’s backend (like WordPress, Shopify, or Squarespace) or the ability to edit its code.
Step-by-Step: Creating Your Google Analytics 4 Account
The latest version of Google Analytics is called GA4. If you're setting up a new account, this is the version you'll be using. Here’s how to get it started.
Step 1: Go to the Google Analytics Website
First, navigate to the Google Analytics homepage. Click the "Start measuring" button to begin the setup process. You'll be prompted to sign in with your Google account if you haven't already.
Step 2: Create Your Account
The first screen asks you to set up your account. An "account" is the highest level of organization and can hold one or more "properties" (your websites or apps).
- Account name: Enter your company name or a name that clearly identifies this account. For example, "My Business Inc."
- Account Data Sharing Settings: These checkboxes allow you to share anonymous data with Google to improve their products. You can review them, but leaving the defaults is fine for most users.
Click "Next" when you’re done.
Step 3: Create a Property
Next, you will create a "property" inside your account. The property represents your website and is where the data from that site will be collected.
- Property name: Use your website’s name. For example, “My Awesome Website.”
- Reporting time zone: Select the time zone you operate in. This ensures your daily reports align with your business day.
- Currency: Choose the currency your business uses (e.g., U.S. Dollar). This is important if you plan to track e-commerce revenue.
Click "Next."
Step 4: Provide Business Details
This page asks for a little more information about your business. Google uses this for industry benchmarking and to tailor your experience.
- Industry category: Pick the one that best fits your business.
- Business size: Select the number of employees.
Click "Next." This information isn't crucial for tracking, so just make your best selections.
Step 5: Choose Your Business Objectives
Here, you can choose what you primarily want to achieve with Google Analytics. These selections help GA4 customize the reports you see in your dashboard sidebar.
Options include things like "Generate leads," "Drive online sales," or "Raise brand awareness." Select what's most relevant to you, or check "Get baseline reports" at the bottom for a general setup.
Click "Create" and accept the Google Analytics Terms of Service when the pop-up appears.
Setting Up Your Data Stream
After creating the account and property, you need to tell Google Analytics where to get the data from. This is called a "data stream."
Step 6: Choose Your Platform
You'll be prompted to choose a platform. Since you're tracking a website, click on "Web."
Step 7: Set Up Your Web Stream
Now, enter your website's details:
- Website URL: Enter your site’s domain (e.g., myamazingwebsite.com). Be sure to select https:// from the dropdown.
- Stream name: This is often your website URL again, for easy identification.
Enhanced measurement will be enabled by default. This is great, as it automatically tracks key user actions like page views, scrolls, outbound clicks, and site search without any extra setup. It's recommended to leave this on.
Click "Create stream."
Step 8: Find Your Measurement ID
Once you create the stream, you'll be taken to the "Web stream details" page. Here you'll find the most important piece of information you need: the Measurement ID.
It will be in the top right corner and look like this: G-XXXXXXXXXX.
This ID is the unique identifier for your website's data stream. You will use this ID to connect your website to Google Analytics. Keep this page open or copy the ID to your clipboard.
Installing the Tracking Info on Your Website
Now it's time to connect your website so data can start flowing. The method you use depends on your website platform. We'll cover the most common ones.
In the "Installation instructions" section of the Web stream details page, you should see options for "Install with a website builder or CMS" or "Install manually."
For WordPress Websites
The easiest method for WordPress is using a plugin, which avoids touching any code directly.
- Go to your WordPress dashboard. Navigate to Plugins > Add New.
- Search for a Google Analytics plugin. Some popular options are Site Kit by Google, GA Google Analytics, or MonsterInsights.
- Install and activate your chosen plugin.
- Follow the plugin's setup instructions. It will usually have a field where you simply paste your "G-..." Measurement ID. Save the settings, and you're done.
For Shopify Stores
Shopify has native integration for Google Analytics, making it very simple.
- From your Shopify admin dashboard, go to Online Store > Preferences.
- Find the "Google Analytics" section.
- Paste your Measurement ID (G-XXXXXXXXXX) into the field.
- Click "Save." That’s it! Shopify handles the rest.
For Squarespace Websites
Squarespace also provides a dedicated field for your Measurement ID.
- In your Squarespace account, go to Settings > Advanced > External API Keys.
- Find the "Google Analytics" field.
- Paste your full Measurement ID (G-XXXXXXXXXX) into the box.
- Click "Save."
For All Other Websites (Manual Installation)
If you have a custom-coded website or your platform doesn't have a direct integration, you'll need to install the code manually.
- On the Google Analytics "Web stream details" page, go to the "Install manually" tab.
- You'll see a snippet of code that starts with
<!-- Global site tag (gtag.js) - Google Analytics -->. - Click the copy icon to copy the entire code block.
- Paste this code snippet immediately after the opening
<head>tag on every single page of your website. If your site uses a common header template, you only need to add it there once.
How to Verify That Google Analytics Is Working
After installing the tracking code, you need to make sure it's working properly. Don't worry, you don't have to wait 24 hours.
Use the Realtime Report
This is the quickest way to check your connection.
- Inside your Google Analytics property, navigate to Reports > Realtime from the left-hand menu.
- Open your website in a separate browser tab or on your phone. To be safe, use an incognito window so you're not logged in as an admin.
- Click around a few pages on your site.
- Back in the Realtime report, you should see the "Users in last 30 minutes" card register "1." You may also see the pages you visited and your location show up.
If you see your activity, congratulations! Google Analytics is successfully installed and tracking data.
Final Thoughts
You’ve successfully added your website to Google Analytics! This single action opens the door to understanding your visitors on a much deeper level and allows you to start making informed, data-driven decisions that will help your business grow. What you did today is the foundation for a much smarter online strategy.
Now that you have all this new data flowing in, figuring out what it all means is the next step. Spreadsheets and navigating GA reports can feel overwhelming, which is why we built Graphed. We let you connect your Google Analytics account in seconds and ask specific questions in plain English - like "Which acquisition channels drove the most valuable users?" or "Show me a chart of my daily traffic for the last 90 days" - to get instant reports and dashboards. No more digging through menus or watching tutorials, just clear answers.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.