How to Implement Google Analytics 4
Setting up Google Analytics 4 is one of the most important first steps for understanding your website's performance. With Universal Analytics now a thing of the past, GA4 isn't just an upgrade, it's a completely new way of thinking about data. This guide provides a clear-cut, step-by-step process for getting GA4 up and running on your website, whether you’re starting from scratch or moving from an old Universal Analytics account.
First, Why Is GA4 Different?
Before jumping into the setup, it helps to understand what makes GA4 a significant shift from its predecessor, Universal Analytics (UA). The biggest change is its data model.
- UA was session-based: It grouped user interactions into "sessions" (visits) and measured metrics like pageviews and bounce rate within those sessions.
- GA4 is event-based: It treats every single user interaction as an "event" - from a page view to a link click, a form submission, or a video play. This provides a more flexible and user-centric view of how people engage with your site across different platforms and devices.
This event-based model is better suited for the modern web, allowing you to track meaningful user actions rather than just passive page views. It’s also built to be more privacy-focused and adaptable for a future without traditional cookies.
Before You Begin: A Quick Checklist
To make the implementation process smooth, make sure you have the following ready:
- A Google Account: You'll need this to access Google Analytics.
- Admin Access to Your Website: You must be able to add code to your site’s HTML header, use a plugin, or have access to Google Tag Manager.
- Your Universal Analytics Login (if migrating): You'll need access to your old UA property to use Google's setup assistant.
Ready? Let's get started.
Option 1: Creating a Brand-New GA4 Property
If you have a new website or have never used Google Analytics before, you'll start fresh. This is the most straightforward path.
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
Step 1: Create Your Google Analytics Account and Property
- Navigate to the Google Analytics website and log in with your Google account.
- Click on "Admin" in the bottom-left corner (the gear icon).
- In the "Account" column, click "Create Account."
- Give your account a name (e.g., the name of your business). Configure the data-sharing settings as you see fit and click "Next."
- Now, you'll create a Property. Enter a "Property name" (e.g., Your Website Name), select your reporting time zone and currency. Click "Next."
- Provide your business details like industry and size. This helps Google tailor your experience. Click "Next."
- Choose your business objectives from the list. This populates your GA4 reporting interface with relevant default reports. Select the ones that best match your goals. Click "Create."
Step 2: Set Up a Data Stream
A "data stream" is simply the source of data flowing into your GA4 property. For a website, this is your primary source.
- On the next screen, you’ll be asked to "Choose a platform." Select "Web."
- Enter your website’s URL (e.g., www.yourwebsite.com) and give the stream a name (usually just your website's name again).
- Make sure "Enhanced measurement" is turned on. This is a powerful feature that automatically tracks events like scrolls, outbound clicks, site searches, and file downloads without any extra setup. Click "Create stream."
You will now see a page with your stream details, including a critical piece of information: your Measurement ID, which looks like G-XXXXXXXXXX. This ID is how Google knows where to send the data. The next section explains what to do with it.
Option 2: Migrating from Universal Analytics Using the "GA4 Setup Assistant"
If you have an existing Universal Analytics property, Google provides a tool to speed things up. It creates a brand-new GA4 property and copies over some of your basic settings from UA.
Heads up: The "Setup Assistant" does not automatically install any tracking code on your site, nor does it move your historical UA data to GA4. It is simply a setup helper. You still need to manually implement the new GA4 tracking tag.
Step 1: Launch the Setup Assistant
- Log into your Universal Analytics account.
- Go to the "Admin" section.
- In the "Property" column, make sure your UA property is selected, then click on "GA4 Setup Assistant." It should be the first option listed.
- Under "I want to create a new Google Analytics 4 property," click the "Get Started" button.
- A pop-up will appear. Don't worry about the "Enable data collection using your existing tags" option unless you're an advanced user. Just click "Create property."
That’s it! Google has now created a new GA4 property for you that is linked to your old UA property. You can find your new Measurement ID by clicking "See your GA4 property" and navigating to Admin > Data Streams > Your Web Stream.
How to Install the GA4 Tag on Your Website
With your Measurement ID in hand, it's time to add the tracking code to your website so GA4 can start collecting data. There are two primary ways to do this.
Method 1: Using Google Tag Manager (GTM) - Highly Recommended
Managing your tracking scripts with GTM is the industry standard. It keeps all your tags (analytics, ad pixels, etc.) in a single container, so you don't have to keep editing your website's code.
- Copy your Measurement ID: Find it in your GA4 Admin panel under Data Streams > [Your Web Stream].
- Log into Google Tag Manager: Open the workspace for your website.
- Create a New Tag: Go to Tags > New. Give your tag a descriptive name like "GA4 Configuration - [Your Site Name]."
- Configure the Tag: Click inside the "Tag Configuration" box and choose "Google Analytics: GA4 Configuration."
- Paste your Measurement ID: In the "Measurement ID" field, paste your
G-XXXXXXXXXXID. Leave the "Send a page view event when this configuration loads" box checked. - Set the Trigger: Next, click the "Triggering" box and select the "All Pages" trigger. This tells GTM to fire the GA4 tag on every public-facing page of your website.
- Save and Publish: Save your new tag. Before making it live, you can use the "Preview" button to test it on your site. Once you confirm it's working, click the "Submit" button in the top right, give your version a name (e.g., "Install GA4"), and publish the container.
Method 2: Manually Adding the Global Site Tag (gtag.js)
If you don't use GTM and have a simple site, you can directly add the GA4 code snippet to your site's HTML.
- Get the Code Snippet: In your GA4 account, go to Admin > Data Streams > [Your Web Stream]. Under "Installation instructions," find the "Install manually" tab. Copy the entire piece of Javascript code.
- Add the Snippet to Your Website's
<head>Section: You need to paste this code immediately after the<head>tag on every single page of your site you want to track. How you do this depends on your website platform:
Verifying Your GA4 Installation
After installing your tag, it's critical to confirm that it's working properly.
- Check the Realtime Report: Go to your GA4 property and open the "Realtime" report from the left-hand navigation. Open your website in a separate browser tab and start clicking around. Within a minute or two, you should see yourself appear as a user on the map and event data beginning to populate.
- Use Google Tag Assistant: For a more detailed debug, go to tagassistant.google.com. You can enter your site's URL, and it will open your site in a new tab with a debug panel. This will show you exactly which tags fired and any errors that occurred.
Essential Next Steps After Installation
Your work isn't done just because the tag is live. Here are a few must-do configurations to get the most out of your new property.
1. Increase Data Retention
By default, GA4 only stores granular user-level data for 2 months. You'll want to extend this immediately.
- Go to Admin > Data Settings > Data Retention.
- Change the "Event data retention" dropdown from "2 months" to "14 months" and hit Save.
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
2. Link Your Google Ads Account
If you run Google Ads, linking the two accounts is vital for tracking campaign performance and sharing audiences.
- Go to Admin > Product Links > Google Ads Links.
- Click "Link" and follow the prompts to select the ad accounts you manage.
3. Review Internal Traffic Definitions
You don't want your own team's visits skewing your data. GA4 can automatically detect your IP address when you're in the Admin sections. You can define this traffic as "Internal" so you can easily filter it out of your reports later.
- Go to Admin > Data Streams > [Your Web Stream] > Configure tag settings > Show more > Define internal traffic.
- Create a rule to define your office IP address and give it the
traffic_typeof "internal."
Final Thoughts
Successfully implementing Google Analytics 4 is a foundational step toward making more informed business decisions. By creating your property, properly installing the tracking tag using a tool like GTM, and completing a few key post-setup configurations, you have established a powerful data collection system that will serve your business for years to come.
Once your GA4 data starts to flow in, the next phase is turning all those events and metrics into clear, actionable insights. Making sense of the new reports can feel like a big hurdle. At Graphed, we made it our mission to remove that complexity. You can connect your GA4 account to Graphed and use simple, conversational language to build dashboards and ask questions. Forget wrestling with the GA4 interface, just ask "What were my top performing landing pages last month?", and get an answer instantly.
Related Articles
Facebook Ads for Home Cleaners: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for home cleaners in 2026. Discover the best ad formats, targeting strategies, and budgeting tips to generate more leads.
Facebook Ads for Pet Grooming: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for pet grooming businesses in 2025. Discover AI-powered creative scaling, pain point discovery strategies, and the new customer offer that works.
AI Marketing Apps: The 15 Best Tools to Scale Your Marketing in 2026
Discover the 15 best AI marketing apps in 2026, from content creation to workflow automation, organized by category with pricing and use cases.