How to Set Up Google Analytics 4 (GA4) for Your Website: Step-by-Step

Last update : June 18, 2026
Contents hide

Setting up Google Analytics 4 is completely free and takes less than 20 minutes. Once installed, GA4 starts collecting data about your visitors, traffic sources, and on-site behavior automatically so you can make smarter decisions about your content and SEO.

Want to learn analytics and SEO alongside other site owners? Join the Scale-Xpert community on Discord, a free space where website owners exchange backlinks, share insights, and grow together.

What You Need Before You Start

You only need two things to get started: a Google account and a live website. No coding skills are required, especially if you use WordPress, Shopify, or any other major CMS platform.

What to know about data history

GA4 does not import data from the old Universal Analytics. Therefore, if you are switching from an older version of Google Analytics, your historical data stays in the old property and your new GA4 property starts fresh. The sooner you set it up, the sooner data collection begins.

Why setup matters for SEO

Before diving in, it helps to understand what Google Analytics 4 is and how it works so you have the right expectations for what each step accomplishes. GA4 is not just a traffic counter. It is the foundation for measuring everything your SEO work produces.

Step 1: Create Your Google Analytics Account

Go to analytics.google.com and sign in with your Google account. If this is your first time, you will see a “Start measuring” button. Click it to begin the account setup process.

Naming your account

On the account creation screen, enter an account name. This is typically your business name or your website brand. One Google Analytics account can hold multiple properties, so if you manage several websites, you only need one account for all of them.

Data sharing settings

Under “Account Data Sharing Settings,” you will see checkboxes related to how Google uses your data for product improvements. These are optional and do not affect your tracking in any way. Review them and adjust based on your preference, then click Next.

Step 2: Create a GA4 Property

A property in GA4 represents your website or app. Think of your account as the folder and your property as the file inside it.

Property setup fields

On the property setup screen, fill in the following:

  • Property name to use your website name or domain, for example “Scale-Xpert Blog”
  • Reporting time zone to select the time zone where your business operates
  • Currency to select your local currency for any revenue reporting

Business details

After filling in the property fields, click Next. GA4 will ask about your industry category and business size. Select the options that best describe your website. On the following screen, choose your primary goal, such as “Get baseline reports” if you are just starting out. Click Create and accept the terms of service to proceed.

Step 3: Set Up a Web Data Stream

A data stream is the live connection between your GA4 property and your actual website. After creating your property, GA4 will prompt you to set one up automatically.

Filling in the stream details

Select “Web” as your platform type, then enter your full website URL including https and give your stream a name. Leave “Enhanced Measurement” toggled on. This activates automatic tracking for scrolls, outbound clicks, site search, video engagement, and file downloads without any extra code.

Your Measurement ID

After clicking “Create stream,” GA4 will immediately display your Measurement ID. It looks like G-XXXXXXXXXX. Copy this ID and save it somewhere accessible because you will need it in the next step to connect GA4 to your website.

Step 4: Install the GA4 Tracking Code on Your Website

This is the step that actually connects GA4 to your website and begins data collection. The method depends on which platform your site runs on.

WordPress: Site Kit by Google (recommended)

The fastest and most reliable method for WordPress users is the free Site Kit by Google plugin. Install and activate it from your WordPress plugin directory, then follow the setup wizard. Site Kit handles the entire GA4 connection without you touching any code whatsoever.

WordPress: manual tag installation

If you prefer to keep your plugin count low, paste the GA4 tag manually by going to Appearance, then Theme File Editor, then header.php. Place the tag just before the closing </head> tag. Be cautious with this approach because theme updates can overwrite any custom code you add.

Google Tag Manager

If you already use Google Tag Manager on your site, deploy GA4 through GTM instead of pasting the code directly. In GTM, create a new tag, select “Google Tag” as the tag type, enter your Measurement ID, and set the trigger to “All Pages.” Publish the container and GA4 will start tracking immediately.

Shopify, Wix, and other platforms

Most major website platforms have a dedicated field for Google Analytics integration. In Shopify, go to Online Store, then Preferences, and paste your Measurement ID in the Google Analytics section. In Wix, go to Marketing and SEO, then Marketing Integrations, then Google Analytics. No code editing is required on either platform.

Step 5: Verify That Tracking Is Working

After installing the GA4 tag, you need to confirm that data is actually being collected before moving on to any other configuration.

Using the Realtime report

Open your GA4 property and click on Reports in the left sidebar, then select Realtime. Open your website in a separate browser tab and visit any page. Within 30 to 60 seconds, your visit should appear in the Realtime report. If it does, your installation is working correctly.

Common reasons tracking does not appear

If your visit does not show up, the most common causes are:

  • The wrong Measurement ID was copied, so double-check for typos
  • The tag was placed in the wrong location, it must be in the <head> and not the <body>
  • A browser extension like an ad blocker is filtering GA4 requests on your end
  • The plugin or GTM container has not been published or saved correctly

Keep in mind that only the Realtime report shows data instantly. Standard reports like Acquisition and Engagement update with a 24 to 48-hour processing delay. Therefore, do not worry if those sections look empty right after setup.

Step 6: Connect GA4 to Google Search Console

This step is optional but highly recommended for any SEO-focused website. Connecting GA4 with Google Search Console lets you see which organic keywords are driving traffic to your site directly inside your analytics reports.

How to link the two tools

Go to your GA4 property’s Admin panel by clicking the gear icon at the bottom left. Under the Property column, click “Search Console Links.” Then click “Link” and follow the prompts to select your verified Search Console property.

What you unlock

Once linked, a Search Console section will appear under your Acquisition reports within 24 hours. This integration helps you understand your organic traffic sources without paying for any third-party SEO tool. It is one of the most practical free combinations available to any website owner.

Step 7: Set Up Your First Conversion Event

GA4 tracks conversions as specific events that matter most to your business goals. By default, GA4 does not mark anything as a conversion automatically, so you need to define at least one yourself.

Common conversion events to track

  • generate_lead to triggered when someone submits a contact form
  • sign_up to triggered when someone subscribes or creates an account
  • purchase to triggered when an e-commerce transaction completes
  • file_download to triggered when someone downloads a resource

How to mark an event as a conversion

Go to Admin, then Events in your property settings. Find the event you want to track and toggle “Mark as conversion” to on. Alternatively, go to Admin, then Conversions, click “New conversion event,” and type the exact event name you want to track.

Setting up even one meaningful conversion event transforms GA4 from a simple traffic counter into a genuine performance measurement tool. It allows you to measure not just how many people visit, but whether they take the specific actions that matter to your goals.

Step 8: Extend Your Data Retention Settings

By default, GA4 only retains event-level data for two months. This is a significant limitation for SEO work because you often want to compare performance across longer time periods.

How to extend retention to 14 months

Go to Admin, then Data Settings, then Data Retention inside your property. Change “Event data retention” from “2 months” to “14 months,” which is the maximum available on the free version. Click Save.

Why this matters

This small change costs nothing and ensures you have a much richer historical dataset when you need it for analysis. It is one of the most overlooked settings in the entire GA4 setup process, and skipping it is one of the common SEO mistakes beginners make when setting up their analytics infrastructure.

Common GA4 Setup Mistakes to Avoid

Even experienced website owners make mistakes during GA4 setup. Knowing them in advance saves you hours of troubleshooting later.

Installing GA4 twice

If you use both a plugin and manually inserted code at the same time, every visit will be counted double and your data will be completely unreliable. Pick one installation method and stick with it.

Skipping Enhanced Measurement

Leaving the Enhanced Measurement toggle off means you miss scroll tracking, outbound link clicks, and file downloads by default. Always leave it on during the data stream setup.

Not setting conversion events

Without at least one conversion event defined, GA4 cannot tell you whether your traffic is valuable or just noise. Setting conversions is what separates useful analytics from a vanity dashboard.

Using the wrong property

If you manage multiple websites, double-check that you are installing the correct Measurement ID on each site. Mixing them up is more common than most people admit, and it corrupts data across all affected properties.

Understanding these mistakes connects directly to the broader importance of on-page SEO fundamentals, where accurate tracking is the baseline for everything else you measure and improve.

If you want to discuss your GA4 setup with other site owners or get feedback on your early reports, the Scale-Xpert Discord community is the right place. Members share analytics wins, backlink strategies, and practical SEO advice every day.

What to Do After Setup Is Complete

Once GA4 is installed and verified, data collection runs entirely in the background. Over the first few weeks, your Acquisition, Engagement, and Retention reports will fill in with real data you can act on.

Review your traffic sources first

Your first stop should be the Acquisition report to see where visitors are coming from. If organic search is low, that is a signal to invest more in your content and backlink quality. If social traffic dominates but organic is nearly zero, you are too dependent on platforms you do not control.

Identify your strongest pages

In Reports, then Engagement, then Pages and Screens, sort by Views or Engagement Time to find which pages your audience reads most. These are your highest-value SEO assets and the best candidates for additional internal links, deeper content updates, and backlink outreach.

Build a review habit

Check your GA4 reports at least once a week. Compare the current week to the previous week, and the current month to the same month last year once you have enough data. In addition, set up a simple monthly note where you record your top traffic sources, top pages, and conversion count. Over time, this creates a clear picture of whether your SEO efforts are producing real results.

FAQs

Does setting up GA4 slow down my website?

No. The GA4 tracking script is lightweight and loads asynchronously, meaning it does not block your page content from rendering. Google hosts the script on globally optimized servers, so the performance impact on your page speed scores is negligible in practice.

Can I install GA4 on multiple websites with one account?

Yes. One Google Analytics account can contain up to 2,000 properties, so you can track as many websites as you need under a single login. Each website gets its own property with its own Measurement ID, and data from different websites never mixes together.

Do I still need Universal Analytics code on my site?

No. Universal Analytics was permanently shut down in July 2023 and no longer processes any data. If you still have old UA code on your site, it is harmless but completely inactive. You can safely remove it to keep your codebase clean.

How do I know if GA4 is already installed?

Open your website in Chrome, right-click the page, select View Page Source, and search for “G-” followed by letters and numbers. If you find a string like G-XXXXXXXXXX in the source code, GA4 is already installed. Alternatively, use the free Google Tag Assistant browser extension, which detects all active Google tags on any page automatically.

Is Google Tag Manager better than installing GA4 directly?

For most beginners, installing GA4 directly through a plugin like Site Kit is simpler and less error-prone. Google Tag Manager is the better choice if you plan to add multiple tracking tools, run custom event tracking, or manage tags across a large site with a team. The data collected is identical regardless of which method you use.

What is a Measurement ID and where do I find it?

Your Measurement ID is the unique identifier for your GA4 data stream and looks like G-XXXXXXXXXX. You can find it by going to Admin, then Data Streams in your GA4 property, then clicking on your web data stream. The Measurement ID is displayed at the top right of the stream details page.

How long before my GA4 reports show useful data?

The Realtime report works immediately. For standard reports to show meaningful patterns, you generally need at least two to four weeks of data. A full picture of seasonal trends and content performance becomes most useful after three to six months of consistent data collection.

Conclusion

Setting up Google Analytics 4 is one of the highest-return actions you can take for your website. It is free, takes less than 20 minutes, and immediately begins collecting the data you need to grow your traffic, improve your content, and understand your audience.

In summary, the eight steps are: create your account, set up a property, create a web data stream, install the tracking code, verify the installation, connect Google Search Console, define conversion events, and extend data retention to 14 months. Each step builds on the previous one, and skipping any of them reduces the quality and usefulness of the data you collect.

Once GA4 is live and collecting data, your next move is learning how to read your reports properly so you can turn raw numbers into clear SEO decisions.

Ready to grow your site with a community that understands the work? Join Scale-Xpert on Discord to exchange backlinks, get feedback on your analytics, and learn SEO alongside site owners who are building alongside you

Connect With SEO Professionals and Build Powerful Backlinks

Join Now

Find the right backlink partners and SEO opportunities to grow your website authority

Trusted by SEO professionals

seo growth

4.8 based on 90+ reviews