How to Set Up Google Analytics 4 (GA4) on Your Website

Nov 7, 2025

How to Set Up Google Analytics 4 (GA4) on Your Website

Setting up Google Analytics 4 the right way is more than just adding code to your website. It's about building a strong base for making smart business decisions based on real data. This complete GA4 setup guide will show you how to track actual user behavior, find out where people leave your site, and spot the weak points in your marketing funnel that cost you money. Whether you're switching from Universal Analytics or starting fresh, this step-by-step guide walks you through everything: creating your property, installing tags through Google Tag Manager, setting up events, and checking that everything works before going live.

Unlike the old Universal Analytics, GA4 works with events instead of sessions. Every action someone takes on your site: viewing pages, clicking buttons, filling forms, making purchases, is tracked as an event. This change means better tracking across devices, more flexibility, and better privacy protection. But it also means your setup matters more than ever. Miss a step or set up an event wrong, and your data will be useless. This GA4 setup guide will help you avoid those mistakes.

Step 1: Create a Google Analytics 4 Property

Before tracking anything, you need a GA4 property. This is your main analytics container that stores all your data, reports, and settings for your website or app.

What is a GA4 Property?

A GA4 property is where all your website or app data lives in Google Analytics. Think of it as your analytics workspace. Each property has data streams (one for each website or app), event settings, audience groups, and reports. Unlike the old Universal Analytics, GA4 properties can handle both website and app data together. This gives you one complete view of how users interact with your brand across all platforms.

To create your property, sign in to your Google Analytics account at analytics.google.com. Click "Admin" at the bottom left, then click "Create Property" under the Property column. Give your property a clear name like "My Company Website - GA4." Choose your time zone and currency, then click "Next." Pick your business type and size, agree to the terms, and you're done creating the property.

Next, add a data stream. Click "Add stream" and choose "Web" for websites. Type in your website URL and stream name (usually just your website address). Turn on Enhanced Measurement if you want automatic tracking for things like scrolling, link clicks, site searches, video views, and file downloads. We'll explain this more in Step 4. Click "Create stream," and GA4 will create a Measurement ID that looks like G-XXXXXXXXXX. Save this ID somewhere safe, you'll need it when installing Google Tag Manager. You can find detailed official instructions in Google's setup documentation.

Step 2: Add GA4 Tag Using Google Tag Manager

Instead of adding GA4 code directly to your website, use Google Tag Manager for cleaner, faster, and more flexible tracking. GTM lets you manage all your tracking tags from one place without changing code every time you need an update.

Why Use Google Tag Manager (GTM)

Google Tag Manager sits between your website and your tracking tools. You install the GTM code once, then control everything through GTM's dashboard. This means your developers don't need to change code for every tracking update. You get version history, a preview mode for testing, and one place to manage multiple tools (GA4, Facebook Pixel, Google Ads, Hotjar). It's faster, safer, and much less likely to break your tracking. For online brands and agencies that need quick tracking changes, GTM is essential. Learn more about GTM benefits from Google's official guide.

How to Install GA4 via GTM

First, set up Google Tag Manager if you haven't yet. Go to tagmanager.google.com, create a free account, and add a new container for your website. Copy the two GTM code pieces (one goes in the <head> section and one in the <body> section) and paste them on every page of your site. If you use WordPress, install a plugin like "Google Tag Manager for WordPress". On Shopify, paste the code into your theme's theme.liquid file. Check Google's installation considerations for platform-specific guidance.

Once GTM is installed, create your GA4 tag. In GTM, click "Tags" then "New." Name it "GA4 Configuration Tag." Choose "Google Analytics: GA4 Configuration" as the tag type. Enter your GA4 Measurement ID (the G-XXXXXXXXXX from Step 1). Under "Triggering," choose "All Pages" so the tag loads on every page. Save the tag.

Before publishing, test using GTM's preview mode. Click "Preview" at the top right of GTM. Type in your website URL and click "Connect." Your website opens in a new tab, and GTM's testing panel shows which tags are loaded. Check that your GA4 Configuration tag shows as "Fired" on page views. If it does, you're good to go. Click "Submit" in GTM to publish your changes live. Add a clear version name like "Initial GA4 Setup" and a description to track what changed.

Step 3: Verify Your Setup

Publishing your tags is one thing. Making sure they actually send data is another. Testing catches setup mistakes before they become data problems.

Use GA4 DebugView & GTM Preview Mode

GA4's DebugView is your real-time testing tool. It shows events as they happen, letting you see exactly what data GA4 receives. To access it, open GA4 and go to "Admin" > "DebugView" under Property settings. You won't see anything yet unless you turn on debug mode.

Turn on debug mode by installing the Google Analytics Debugger Chrome extension or adding ?debug_mode=true at the end of your URL. Visit your site in that browser, and DebugView will show real-time events. Look for the page_view event on every page. Check the details to make sure they're capturing the right page titles, URLs, and any custom information you set up.

Use this together with GTM Preview Mode for complete testing. In GTM's testing panel, expand each tag and check the information it sent. Common problems include: GA4 Configuration tag not loading at all (check your trigger settings), wrong Measurement ID (double-check the G- prefix), or events firing multiple times (look for duplicate tags or triggers). Fix any mistakes in GTM, save, and test again before publishing.

If you're working with a CRO agency like FunnelFreaks, this is where they'll double-check your setup to make sure your data is accurate from day one. Proper validation prevents the kind of friction that comes from bad data leading to wrong decisions.

Step 4: Configure Basic Events

GA4 tracks some actions automatically, but you'll want to choose which events matter for your business and add custom tracking when needed.

Use Enhanced Measurement

Enhanced Measurement is GA4's built-in automatic tracking for common website actions. When you created your data stream in Step 1, you could turn it on. If you didn't, go to "Admin" → "Data Streams" → select your web stream → scroll to "Enhanced measurement" and switch it on.

Enhanced Measurement automatically tracks these events: page views, scrolling (when someone scrolls 90% down a page), clicks on links to other websites, searches on your site, video plays (YouTube videos), and file downloads (PDFs and documents). These events work automatically, no extra setup needed. You can turn individual Enhanced Measurement events on or off based on what matters to you. For example, if scroll tracking isn't important to your business, turn it off to keep your reports cleaner. Learn more about Enhanced Measurement in Google's official documentation.

Add Custom Events (Optional)

Enhanced Measurement covers basic tracking, but custom events let you track actions specific to your business. Common examples include form submissions, button clicks, demo requests, or phone number taps. You set up custom events in Google Tag Manager.

To create a custom event, make a new tag in GTM. Choose "Google Analytics: GA4 Event" as the tag type. Enter your GA4 Measurement ID (or link to your Configuration Tag settings). Add an Event Name like button_click or form_submit. Set up the trigger: for button clicks, use a "Click - All Elements" trigger with rules like "Click URL contains 'checkout'" or "Click Classes contains 'cta-button'". For form submissions, use a "Form Submission" trigger. Preview your changes in GTM, test the action on your site, and check that the event shows up in GA4 DebugView. Once confirmed, publish the tag.

Why Event Naming Consistency Matters

GA4 is very picky about event names. It treats uppercase and lowercase letters as different, so add_to_cart is NOT the same as Add_To_Cart or addToCart. Mixed-up naming breaks your data and makes reports useless. Use GA4's recommended event names whenever possible: purchase, add_to_cart, begin_checkout, view_item, generate_lead. These names work with GA4's built-in reports. For your own custom events, use lowercase letters with underscores between words (form_submit, button_click) and write down your naming system for your team. Being consistent with names is what separates useful data from a mess. This consistency helps when you're doing funnel analysis to spot where people drop off.

Step 5: Link GA4 with Other Tools

GA4 works best when connected to other platforms. Linking it with Google Ads, Search Console, BigQuery, and other tools creates one complete data system that helps you make better marketing choices.

Start with Google Ads if you run paid ads. In GA4, go to "Admin" → "Product Links" → "Google Ads Links" → "Link." Choose your Google Ads account and confirm. This lets you import conversions, share audiences, and see how organic and paid traffic work together. Link Google Search Console to see organic search data. Go to "Product Links" → "Search Console Links" and connect your Search Console property. You'll see search terms, impressions, and clicks right in GA4.

For advanced users, connect GA4 to BigQuery for raw event data exports. This is free for up to 1 million events per day and critical if you need custom analysis or data storage. Connect Looker Studio (used to be called Data Studio) to GA4 for custom dashboards that show your most important numbers in real time. These connections make GA4 more powerful and help your data drive better insights across your entire team.

Common Mistakes to Avoid in GA4 Setup

Even experienced marketers make these errors. Catching them early saves months of bad data and helps you avoid generating lead generation campaigns based on wrong information.

First, don't skip DebugView testing. Publishing tags without testing is like gambling with your data. Second, don't add GA4 code directly to your site instead of using GTM, you'll regret it the first time you need to update tracking. Third, don't ignore event naming rules. Mixed-up names break your data. Fourth, don't set up duplicate tags that fire on the same trigger, this inflates your numbers and makes reports wrong. Fifth, don't forget to block internal traffic by setting up IP filters in GA4's data stream settings. Views from your own team mess up reports and waste your event limit.

Another common mistake: not writing down your setup. Create a simple tracking document that lists your GA4 Measurement ID, GTM Container ID, custom events, triggers, and any special settings. When someone asks "What are we tracking?" six months later, you'll have the answer. Finally, don't set up GA4 and forget about it. Good analytics needs regular attention. Check your setup every few months to make sure tags are working, events are clean, and reports match your real business goals. This ongoing maintenance is part of good marketing operations.

How to Test and Validate Your GA4 Setup

Testing doesn't stop after the first setup. Regular checks keep your data accurate as your website changes.

Use GA4's Realtime report to confirm events are working. Open "Reports" → "Realtime" in GA4, then open your website in another tab. Do actions like viewing pages, submitting forms, or clicking buttons. Within seconds, you should see these events appear in the Realtime report. Check that user counts match your test visits and that event names are correct.

Run a complete user journey test. Start from a landing page, move through your site, add a product to cart (if you sell things), and complete a conversion. Check that every step fires the right events. Use GTM Preview Mode and GA4 DebugView at the same time for full testing. If something's missing, trace it back to the trigger in GTM. After a few days of data collection, check your funnel analysis to make sure conversion paths are tracking correctly.

Final Checklist Before You Go Live

Before calling your GA4 setup complete, go through this checklist:

  • GA4 property created with correct time zone and currency

  • Data stream set up with Enhanced Measurement turned on

  • GTM container installed on all site pages

  • GA4 Configuration tag fires on all pages (checked in GTM Preview)

  • Event names follow the same naming rules

  • Setup written down for team reference

Once everything is checked, you're ready to go live. Watch your reports every day for the first week to catch any problems early. GA4 data isn't saved backward, what you miss now is gone forever. 

Wrapping Up. Why a Proper Setup Matters

A clean GA4 setup is the foundation of every smart marketing decision you'll make. Without accurate tracking, you're guessing which campaigns work, where users leave your site, and what changes actually help conversions. Bad data creates bad decisions, and bad decisions waste money and lose customers.

The difference between a rushed GA4 setup and a proper one isn't just about data quality, it's about real business impact. When your analytics works right, you can confidently grow what's working, stop what isn't, and improve your funnel based on real user behavior. You're not chasing meaningless numbers, you're fixing leaks, making better experiences, and building steady growth. This is exactly what CRO agencies focus on: using clean data to reduce friction and improve conversions.

If your current GA4 setup feels uncertain or you're not confident in your data, it's worth getting expert help. At FunnelFreaks, we set up GA4 and GTM the right way for online brands; clean tracking, custom events, and dashboards that actually help you make decisions. Because your funnel can't get better if you can't measure it properly.

Ready to fix your analytics and stop guessing? Let's talk.

Setting up Google Analytics 4 the right way is more than just adding code to your website. It's about building a strong base for making smart business decisions based on real data. This complete GA4 setup guide will show you how to track actual user behavior, find out where people leave your site, and spot the weak points in your marketing funnel that cost you money. Whether you're switching from Universal Analytics or starting fresh, this step-by-step guide walks you through everything: creating your property, installing tags through Google Tag Manager, setting up events, and checking that everything works before going live.

Unlike the old Universal Analytics, GA4 works with events instead of sessions. Every action someone takes on your site: viewing pages, clicking buttons, filling forms, making purchases, is tracked as an event. This change means better tracking across devices, more flexibility, and better privacy protection. But it also means your setup matters more than ever. Miss a step or set up an event wrong, and your data will be useless. This GA4 setup guide will help you avoid those mistakes.

Step 1: Create a Google Analytics 4 Property

Before tracking anything, you need a GA4 property. This is your main analytics container that stores all your data, reports, and settings for your website or app.

What is a GA4 Property?

A GA4 property is where all your website or app data lives in Google Analytics. Think of it as your analytics workspace. Each property has data streams (one for each website or app), event settings, audience groups, and reports. Unlike the old Universal Analytics, GA4 properties can handle both website and app data together. This gives you one complete view of how users interact with your brand across all platforms.

To create your property, sign in to your Google Analytics account at analytics.google.com. Click "Admin" at the bottom left, then click "Create Property" under the Property column. Give your property a clear name like "My Company Website - GA4." Choose your time zone and currency, then click "Next." Pick your business type and size, agree to the terms, and you're done creating the property.

Next, add a data stream. Click "Add stream" and choose "Web" for websites. Type in your website URL and stream name (usually just your website address). Turn on Enhanced Measurement if you want automatic tracking for things like scrolling, link clicks, site searches, video views, and file downloads. We'll explain this more in Step 4. Click "Create stream," and GA4 will create a Measurement ID that looks like G-XXXXXXXXXX. Save this ID somewhere safe, you'll need it when installing Google Tag Manager. You can find detailed official instructions in Google's setup documentation.

Step 2: Add GA4 Tag Using Google Tag Manager

Instead of adding GA4 code directly to your website, use Google Tag Manager for cleaner, faster, and more flexible tracking. GTM lets you manage all your tracking tags from one place without changing code every time you need an update.

Why Use Google Tag Manager (GTM)

Google Tag Manager sits between your website and your tracking tools. You install the GTM code once, then control everything through GTM's dashboard. This means your developers don't need to change code for every tracking update. You get version history, a preview mode for testing, and one place to manage multiple tools (GA4, Facebook Pixel, Google Ads, Hotjar). It's faster, safer, and much less likely to break your tracking. For online brands and agencies that need quick tracking changes, GTM is essential. Learn more about GTM benefits from Google's official guide.

How to Install GA4 via GTM

First, set up Google Tag Manager if you haven't yet. Go to tagmanager.google.com, create a free account, and add a new container for your website. Copy the two GTM code pieces (one goes in the <head> section and one in the <body> section) and paste them on every page of your site. If you use WordPress, install a plugin like "Google Tag Manager for WordPress". On Shopify, paste the code into your theme's theme.liquid file. Check Google's installation considerations for platform-specific guidance.

Once GTM is installed, create your GA4 tag. In GTM, click "Tags" then "New." Name it "GA4 Configuration Tag." Choose "Google Analytics: GA4 Configuration" as the tag type. Enter your GA4 Measurement ID (the G-XXXXXXXXXX from Step 1). Under "Triggering," choose "All Pages" so the tag loads on every page. Save the tag.

Before publishing, test using GTM's preview mode. Click "Preview" at the top right of GTM. Type in your website URL and click "Connect." Your website opens in a new tab, and GTM's testing panel shows which tags are loaded. Check that your GA4 Configuration tag shows as "Fired" on page views. If it does, you're good to go. Click "Submit" in GTM to publish your changes live. Add a clear version name like "Initial GA4 Setup" and a description to track what changed.

Step 3: Verify Your Setup

Publishing your tags is one thing. Making sure they actually send data is another. Testing catches setup mistakes before they become data problems.

Use GA4 DebugView & GTM Preview Mode

GA4's DebugView is your real-time testing tool. It shows events as they happen, letting you see exactly what data GA4 receives. To access it, open GA4 and go to "Admin" > "DebugView" under Property settings. You won't see anything yet unless you turn on debug mode.

Turn on debug mode by installing the Google Analytics Debugger Chrome extension or adding ?debug_mode=true at the end of your URL. Visit your site in that browser, and DebugView will show real-time events. Look for the page_view event on every page. Check the details to make sure they're capturing the right page titles, URLs, and any custom information you set up.

Use this together with GTM Preview Mode for complete testing. In GTM's testing panel, expand each tag and check the information it sent. Common problems include: GA4 Configuration tag not loading at all (check your trigger settings), wrong Measurement ID (double-check the G- prefix), or events firing multiple times (look for duplicate tags or triggers). Fix any mistakes in GTM, save, and test again before publishing.

If you're working with a CRO agency like FunnelFreaks, this is where they'll double-check your setup to make sure your data is accurate from day one. Proper validation prevents the kind of friction that comes from bad data leading to wrong decisions.

Step 4: Configure Basic Events

GA4 tracks some actions automatically, but you'll want to choose which events matter for your business and add custom tracking when needed.

Use Enhanced Measurement

Enhanced Measurement is GA4's built-in automatic tracking for common website actions. When you created your data stream in Step 1, you could turn it on. If you didn't, go to "Admin" → "Data Streams" → select your web stream → scroll to "Enhanced measurement" and switch it on.

Enhanced Measurement automatically tracks these events: page views, scrolling (when someone scrolls 90% down a page), clicks on links to other websites, searches on your site, video plays (YouTube videos), and file downloads (PDFs and documents). These events work automatically, no extra setup needed. You can turn individual Enhanced Measurement events on or off based on what matters to you. For example, if scroll tracking isn't important to your business, turn it off to keep your reports cleaner. Learn more about Enhanced Measurement in Google's official documentation.

Add Custom Events (Optional)

Enhanced Measurement covers basic tracking, but custom events let you track actions specific to your business. Common examples include form submissions, button clicks, demo requests, or phone number taps. You set up custom events in Google Tag Manager.

To create a custom event, make a new tag in GTM. Choose "Google Analytics: GA4 Event" as the tag type. Enter your GA4 Measurement ID (or link to your Configuration Tag settings). Add an Event Name like button_click or form_submit. Set up the trigger: for button clicks, use a "Click - All Elements" trigger with rules like "Click URL contains 'checkout'" or "Click Classes contains 'cta-button'". For form submissions, use a "Form Submission" trigger. Preview your changes in GTM, test the action on your site, and check that the event shows up in GA4 DebugView. Once confirmed, publish the tag.

Why Event Naming Consistency Matters

GA4 is very picky about event names. It treats uppercase and lowercase letters as different, so add_to_cart is NOT the same as Add_To_Cart or addToCart. Mixed-up naming breaks your data and makes reports useless. Use GA4's recommended event names whenever possible: purchase, add_to_cart, begin_checkout, view_item, generate_lead. These names work with GA4's built-in reports. For your own custom events, use lowercase letters with underscores between words (form_submit, button_click) and write down your naming system for your team. Being consistent with names is what separates useful data from a mess. This consistency helps when you're doing funnel analysis to spot where people drop off.

Step 5: Link GA4 with Other Tools

GA4 works best when connected to other platforms. Linking it with Google Ads, Search Console, BigQuery, and other tools creates one complete data system that helps you make better marketing choices.

Start with Google Ads if you run paid ads. In GA4, go to "Admin" → "Product Links" → "Google Ads Links" → "Link." Choose your Google Ads account and confirm. This lets you import conversions, share audiences, and see how organic and paid traffic work together. Link Google Search Console to see organic search data. Go to "Product Links" → "Search Console Links" and connect your Search Console property. You'll see search terms, impressions, and clicks right in GA4.

For advanced users, connect GA4 to BigQuery for raw event data exports. This is free for up to 1 million events per day and critical if you need custom analysis or data storage. Connect Looker Studio (used to be called Data Studio) to GA4 for custom dashboards that show your most important numbers in real time. These connections make GA4 more powerful and help your data drive better insights across your entire team.

Common Mistakes to Avoid in GA4 Setup

Even experienced marketers make these errors. Catching them early saves months of bad data and helps you avoid generating lead generation campaigns based on wrong information.

First, don't skip DebugView testing. Publishing tags without testing is like gambling with your data. Second, don't add GA4 code directly to your site instead of using GTM, you'll regret it the first time you need to update tracking. Third, don't ignore event naming rules. Mixed-up names break your data. Fourth, don't set up duplicate tags that fire on the same trigger, this inflates your numbers and makes reports wrong. Fifth, don't forget to block internal traffic by setting up IP filters in GA4's data stream settings. Views from your own team mess up reports and waste your event limit.

Another common mistake: not writing down your setup. Create a simple tracking document that lists your GA4 Measurement ID, GTM Container ID, custom events, triggers, and any special settings. When someone asks "What are we tracking?" six months later, you'll have the answer. Finally, don't set up GA4 and forget about it. Good analytics needs regular attention. Check your setup every few months to make sure tags are working, events are clean, and reports match your real business goals. This ongoing maintenance is part of good marketing operations.

How to Test and Validate Your GA4 Setup

Testing doesn't stop after the first setup. Regular checks keep your data accurate as your website changes.

Use GA4's Realtime report to confirm events are working. Open "Reports" → "Realtime" in GA4, then open your website in another tab. Do actions like viewing pages, submitting forms, or clicking buttons. Within seconds, you should see these events appear in the Realtime report. Check that user counts match your test visits and that event names are correct.

Run a complete user journey test. Start from a landing page, move through your site, add a product to cart (if you sell things), and complete a conversion. Check that every step fires the right events. Use GTM Preview Mode and GA4 DebugView at the same time for full testing. If something's missing, trace it back to the trigger in GTM. After a few days of data collection, check your funnel analysis to make sure conversion paths are tracking correctly.

Final Checklist Before You Go Live

Before calling your GA4 setup complete, go through this checklist:

  • GA4 property created with correct time zone and currency

  • Data stream set up with Enhanced Measurement turned on

  • GTM container installed on all site pages

  • GA4 Configuration tag fires on all pages (checked in GTM Preview)

  • Event names follow the same naming rules

  • Setup written down for team reference

Once everything is checked, you're ready to go live. Watch your reports every day for the first week to catch any problems early. GA4 data isn't saved backward, what you miss now is gone forever. 

Wrapping Up. Why a Proper Setup Matters

A clean GA4 setup is the foundation of every smart marketing decision you'll make. Without accurate tracking, you're guessing which campaigns work, where users leave your site, and what changes actually help conversions. Bad data creates bad decisions, and bad decisions waste money and lose customers.

The difference between a rushed GA4 setup and a proper one isn't just about data quality, it's about real business impact. When your analytics works right, you can confidently grow what's working, stop what isn't, and improve your funnel based on real user behavior. You're not chasing meaningless numbers, you're fixing leaks, making better experiences, and building steady growth. This is exactly what CRO agencies focus on: using clean data to reduce friction and improve conversions.

If your current GA4 setup feels uncertain or you're not confident in your data, it's worth getting expert help. At FunnelFreaks, we set up GA4 and GTM the right way for online brands; clean tracking, custom events, and dashboards that actually help you make decisions. Because your funnel can't get better if you can't measure it properly.

Ready to fix your analytics and stop guessing? Let's talk.