Google Analytics dashboard illustration Website · Analytics

How to Add Google Analytics to Your Website (And What to Track)

Updated June 2026 7 min read

In This Article

  1. Why tracking matters
  2. Step 1: Create a GA4 account
  3. Step 2: Set up a property
  4. Step 3: Get your Measurement ID
  5. Step 4: Add the tracking code
  6. Step 5: Verify it's working
  7. Step 6: Set up key events
  8. Step 7: Connect to Google Search Console
  9. Metrics that matter for local businesses
  10. What to ignore
  11. FAQ

Running a website without analytics is like running a store without knowing how many people walked in, which products they looked at, and why they left without buying. Google Analytics 4 (GA4) is free, powerful, and takes about 20 minutes to set up. Here's exactly how to do it — and more importantly, what to actually pay attention to once the data starts coming in.

Why tracking matters more than you think

Without tracking, you're guessing. You might assume your homepage is doing its job — but analytics might show you that 80% of your visitors leave without scrolling past the fold. You might think your blog is driving traffic — but the data might reveal it's your "Services" page that's responsible for most contact form submissions.

Analytics tells you where people come from, what they do on your site, and where you lose them. With that data, you can make decisions that actually improve results — not just redesign for the sake of redesigning.

1

Create a Google Analytics account

Go to analytics.google.com. Sign in with the Google account you want to own the analytics data — ideally a business Gmail, not a personal one.

Click "Start measuring." You'll be prompted to create an Account Name (use your business name) and then a Property.

2

Set up a GA4 property

During setup, make sure you're creating a GA4 property — not Universal Analytics (which was sunset in 2023). When asked for the platform, choose "Web." Enter your website URL and give the property a name. Select your industry category and reporting time zone.

Warning

If you see any reference to "Universal Analytics" or "UA-" in the setup flow, you're looking at an outdated version. GA4 properties start with "G-" not "UA-". Make sure you're on the right one.

3

Get your Measurement ID

After creating the property, go to Admin → Data Streams → click your web stream. You'll see your Measurement ID — it looks like G-XXXXXXXXXX. Copy this. You'll need it in the next step.

Pro Tip

While you're here, enable "Enhanced measurement" — it automatically tracks page views, scroll depth, outbound clicks, and video engagement without extra setup.

4

Add the tracking code to your website

Paste this code in the <head> section of every page on your site, replacing G-XXXXXXXXXX with your actual Measurement ID.

<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>

If you're on WordPress: Install the "Site Kit by Google" plugin — it handles the installation automatically and connects Search Console too.

If you're on Webflow: Go to Project Settings → Custom Code → paste in the Head code section.

If you're on Squarespace: Go to Settings → Advanced → Code Injection → paste in the Header.

If you use Google Tag Manager: Add a GA4 Configuration tag with your Measurement ID instead of pasting directly.

From Aaron's Reading List
Get it on Amazon

Get more customers already searching for you.

See exactly where you're missing customers on your website and Google Business Profile — free, in minutes, no card. And get the exact fixes to win them back — free. Want them done for you? We offer done-for-you at the bottom of your report.

Get My Free Report

100% free · Full report + the fixes · Nothing to buy

7

Connect to Google Search Console

Google Search Console shows you what search queries bring people to your site. Connecting it to GA4 lets you see that data alongside your analytics.

To connect: In GA4, go to Admin → Property Settings → Search Console Links → Link.

Sign in to Search Console at search.google.com/search-console. If you haven't verified your site there yet, you'll need to do that first — use the "HTML tag" verification method (paste a meta tag in your head).

Once connected, find the combined data in GA4 under Reports → Acquisition → Search Console.

Metrics that actually matter for local businesses

Don't get lost in the data. These are the numbers that actually tell you something useful:

Check these once a week, not every day. Looking too often at short-term data creates noise, not insight.

What to stop obsessing over

Bounce rate — GA4 replaced it with Engaged Sessions, which is better. Don't stress over a high bounce rate.

Page views alone — a page with 10,000 views and zero conversions isn't doing its job. A page with 100 views and 20 phone calls is.

Averages — average session duration, average pages per session. These are blended numbers that hide more than they reveal.

Focus on the metrics listed above and ignore the rest until you've got the basics humming.

Get more customers already searching for you.

See exactly where you're missing customers on your website and Google Business Profile — free, in minutes, no card. And get the exact fixes to win them back — free. Want them done for you? We offer done-for-you at the bottom of your report.

Get My Free Report

100% free · Full report + the fixes · Nothing to buy

Frequently Asked Questions

The Realtime report shows live data within minutes of installation. Standard reports take 24–48 hours to populate. You'll have a full picture of your first week's traffic within about 2 days of setting up.

Minimally. The GA4 tag loads asynchronously, meaning it doesn't block your page from loading. In PageSpeed tests, it may show as a minor deduction, but it won't meaningfully hurt your user experience or rankings. The data you gain is worth it.

Universal Analytics (UA) was the previous version of Google Analytics. Google shut it down in July 2023 — it no longer collects data. GA4 is the current version. If your site still has a UA tracking ID (starts with UA-), you need to set up GA4 immediately — you've been flying blind since mid-2023.

Make sure your phone number is an actual link using href='tel:+15551234567'. Then in Google Tag Manager, create a trigger that fires on clicks to links starting with 'tel:'. Fire a GA4 event tag called 'phone_click'. Mark it as a conversion in GA4. This gives you a count of how many people tapped your phone number from your website.

Yes. Google Analytics collects data about your visitors, which triggers privacy disclosure requirements in most jurisdictions. At minimum, your privacy policy should mention that you use Google Analytics to collect anonymous usage data. This is required in the EU (GDPR), California (CCPA), and increasingly other states. A privacy policy page is good practice regardless.