How to Get Google Analytics for Any Website

Cody Schneider10 min read

Putting a website online without a way to measure its traffic is like opening a store with the doors locked. To understand your visitors and grow your business, you need data. This article guides you through every step of getting Google Analytics up and running on your website, from creating an account to verifying that everything is working correctly.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

What is Google Analytics and Why Do You Need It?

Google Analytics is a free web analytics service from Google that tracks and reports website traffic. It answers fundamental questions about your digital presence that you simply can't guess. Instead of flying blind, you get concrete data to help you understand your audience and make smarter decisions.

Here are just a few key questions Google Analytics can answer for you:

  • Who is visiting your website? Discover the age, gender, location, and interests of your visitors. You can also see what kind of device (desktop, tablet, or mobile) they use to browse your site.
  • How did they find you? Learn which channels drive the most traffic. Did visitors come from a Google search (organic traffic), a Facebook Ad (paid social), a link in your email newsletter (email), or by typing your URL directly into their browser (direct)?
  • What pages are they looking at? See your most popular content, landing pages, and the pages where people most often leave your site. This helps you figure out what's working and what isn't.
  • Are your marketing efforts paying off? By tracking traffic sources and on-site conversions (like form submissions or purchases), you can measure the return on investment (ROI) for your marketing campaigns.

Think of it as the central nervous system for your website. It collects all the signals and presents them in a way that helps you understand what’s happening, what your audience cares about, and where you should focus your efforts.

GA4 vs. Universal Analytics: A Quick Primer

If you're new to Google Analytics, you’ll be starting with the latest version, known as Google Analytics 4. You might see older tutorials that mention "Universal Analytics" or "UA." That was the previous generation of Google Analytics, which was officially phased out in July 2023.

There's no need to get lost in the technical details, but the most important difference to understand is how they measure things.

  • Universal Analytics (UA) was session-based. It thought in terms of visits, and everything a user did within that visit was bundled together.
  • Google Analytics 4 is event-based. It treats every single interaction - a page view, a scroll, a click, a purchase - as a separate "event."

Why the change? The event-based model is far more flexible and better suited for today's internet, where a customer's journey might start on your website, move to your mobile app, and end back on the website. GA4 is designed to give you a more unified and complete view of that entire journey.

All new analytics properties are GA4, so that’s exactly what we’ll be setting up today.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Getting Started: Creating Your Google Analytics Account

Setting up your account is a straightforward process that takes just a few minutes. To begin, you’ll need a Google account (like a Gmail address).

Step 1: Go to the Google Analytics Website

Navigate to https://analytics.google.com and sign in with your Google account. If you don't have one connected to analytics yet, you'll be greeted with a welcome screen. Click the "Start measuring" button.

Step 2: Create an Account

First, you need an "Account." Think of this as the top-level folder that can hold multiple properties (websites or apps). Give it a name - typically your company or organization's name.

Below the account name, you’ll see several data-sharing settings. These options control how your anonymous data is shared with Google to help them improve their products and provide benchmarking data. You can review them and check or uncheck them as you see fit. Click "Next" when you're ready.

Step 3: Create a Property

A "Property" represents your website or app. If your brand had a website and a mobile app, you would create a separate property for each under the same account.

  • Property name: Give your property a clear name, like "My Awesome Website."
  • Reporting time zone: Select your local time zone so that daily reports reset at midnight your time, not Google's.
  • Currency: Choose the currency you use for your business.

Click "Next" to continue.

Step 4: Provide Business Details

In this section, Google asks for some basic information about your business, like your industry category and company size. This information is used to provide you with relevant benchmarking data and tailor your reporting experience. Fill it out and click "Next."

Step 5: Choose Your Business Objectives

Next, you’ll select your top goals. Are you trying to generate leads, drive online sales, or raise brand awareness? Checking these boxes helps GA4 customize the types of reports it shows you by default. You can select one or more. After you choose, click "Create" and accept the Google Analytics Terms of Service Agreement.

Connecting Your Website: Putting the GA4 Tag in Place

With the account created, you now need to connect it to your website so it can start collecting data. This connection happens through a piece of JavaScript code often called the "GA tag" or "tracking code."

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Step 1: Set Up a Data Stream

Immediately after creating your property, you'll be prompted to "Choose a platform." This is where you set up a "data stream" - the source from which data flows into your property.

Since we're setting this up for a website, click on "Web."

Step 2: Configure Your Web Stream

Here, you'll provide your website's URL (e.g., 'https://www.yourwebsite.com') and give the stream a name (e.g., "My Website's Data Stream").

You’ll notice a feature called "Enhanced measurement." Leave this enabled! It’s a huge benefit of GA4, as it automatically tracks several important interactions without any extra setup from you, including page views, scrolls, outbound link clicks, site search, and file downloads.

Click "Create stream."

Step 3: Get Your Measurement ID and Tracking Code

Once you create the stream, a new "Web stream details" page will appear. This page is filled with important information, but two things are key:

  • Measurement ID: This is a unique identifier for your data stream, which looks like G-XXXXXXXXXX. This is often all you need if you're using a website builder with a built-in integration.
  • Global site tag (gtag.js): This is the full JavaScript code snippet. You'll need this if you plan to install the tag manually into your website's HTML. You can find it under the "View tag instructions" section.

Keep this page open. Now, it's time to add this to your site.

How to Install the Google Analytics Tag (Top 3 Methods)

There are several ways to install the tag, depending on how your website is built. Here are the most common methods, from easiest to most advanced.

Method 1: Using a Website Platform's Built-in Integration (Easiest)

Most modern website builders and content management systems (CMS) have a dedicated field where you can simply paste your "Measurement ID" — no coding required.

  • WordPress: While you can edit theme files directly, the easiest way is with a plugin. Google’s official Site Kit plugin makes it a matter of a few clicks. Other popular options like MonsterInsights or All in One SEO also have simple setup wizards.
  • Shopify: In your Shopify admin, go to Online Store > Preferences. You'll find a 'Google Analytics' section where you can paste your Measurement ID.
  • Squarespace: Go to Marketing > Marketing Tools, find the "Google Analytics" option, and paste in your Measurement ID.
  • Wix: From your dashboard, navigate to Marketing & SEO > Marketing Integrations. Select Google Analytics, click "Connect," and follow the prompts to add your Measurement ID.

Method 2: Manually Adding the Code to Your Website (For Custom Sites)

If your site is custom-built or your platform doesn't have an integration, you can add the tracking code directly to your site’s HTML.

  1. From your GA4 "Web stream details," click "View tag instructions" and find the "Install manually" tab.
  2. Copy the entire gtag.js code snippet.
  3. Paste this code immediately after the opening <head> tag on every single page of your website you want to track. If your site uses a template or header file, adding it there once will apply it to all pages.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-YOUR_MEASUREMENT_ID"></script>
<script>
  window.dataLayer = window.dataLayer || [],
  function gtag(){dataLayer.push(arguments),}
  gtag('js', new Date()),

  gtag('config', 'G-YOUR_MEASUREMENT_ID'),
</script>
GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Method 3: Using Google Tag Manager (Most Flexible)

For those who handle multiple tracking scripts (like a Facebook Pixel, an ads conversion tag, etc.), Google Tag Manager (GTM) is the best practice. It acts as a container for all your tags so you only have to put one piece of code on your site.

The basic workflow is:

  • Set up a Google Tag Manager account and container.
  • Install the GTM code snippet on your website.
  • Inside GTM, create a new Tag and choose the "Google Analytics: GA4 Configuration" type.
  • Paste your GA4 Measurement ID into the appropriate field.
  • Set the tag to trigger on "All Pages."
  • Save, preview, and publish your GTM container.

This method gives you much more control and is easier to manage in the long run but has a slightly steeper learning curve initially.

Verifying Your Setup: Is it Working?

Once you’ve installed the tag, you'll want to confirm that Google is receiving data. The best way to do this is with the Real-time report.

  1. In your Google Analytics property, navigate to the sidebar menu and click on Reports > Realtime.
  2. In a new browser tab or on your phone, open your website.
  3. Switch back to the Real-time report in Google Analytics. Within about 30-60 seconds, you should see the number of "Users in last 30 minutes" change to at least 1.

If you see your activity, congratulations! Google Analytics is successfully installed on your website. Keep in mind that most of the standard reports can take between 24 and 48 hours to fully process and display data, so don't panic if they look empty at first.

Final Thoughts

Setting up Google Analytics is a foundational first step to running a data-driven website. It moves you from guessing about performance to understanding exactly what your visitors are doing. By following the steps above, you can get a powerful free analytics tool working for you and start collecting the insights needed to reach your goals.

Once data starts flowing into your Google Analytics account, the next goal is turning all those numbers into clear, simple answers. Instead of spending hours learning how to build custom GA4 reports, we find most people want to just ask direct questions. That's why we built Graphed. It connects to your Google Analytics account and lets you ask questions in plain English — like "Which campaigns are driving the most new users?" — and instantly builds live dashboards that actually answer your question.

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!