How to Get Google Analytics 4
Getting your website set up with Google Analytics 4 is one of the most important first steps in understanding your audience and measuring performance. This guide provides a straightforward walkthrough for installing GA4, whether you're starting from scratch with a new website or upgrading from the older Universal Analytics.
What Exactly is Google Analytics 4?
Google Analytics 4 is the latest version of Google's web analytics platform. It's a complete redesign from the previous version, Universal Analytics (UA), which officially stopped processing data in July 2023. If you want to use Google Analytics, you now need to use GA4.
But this isn't just a simple update, it's a fundamental shift in how data is collected and analyzed. Here are the key differences:
- Event-Based Model: Unlike UA, which tracked "sessions" and "pageviews," GA4 treats every user interaction as an "event." A page view is an event, a button click is an event, a form submission is an event. This model provides a far more flexible and comprehensive view of the user journey.
- Cross-Platform Tracking: GA4 is built to measure a single user's journey across both your website and your mobile app, giving you a unified understanding of user behavior.
- Privacy-Focused: With growing privacy regulations and the decline of cookies, GA4 was built to be less reliant on them. It uses advanced machine learning and statistical modeling to fill in data gaps when cookies aren't available, providing insights while respecting user privacy.
- Enhanced Measurement Out of the Box: GA4 automatically tracks key interactions like scrolls, outbound clicks, site searches, and video engagement with no extra setup required. In UA, you had to configure these events manually through Google Tag Manager.
Essentially, moving to GA4 is not just recommended, it's necessary for modern, future-proof analytics.
How to Install Google Analytics 4
We'll cover two main scenarios. The first is for anyone setting up a brand new website that has never used Google Analytics before. The second is for those who have an old Universal Analytics property and need to move to GA4.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Scenario 1: Setting up GA4 on a New Website
If you're starting completely fresh, the process is quite simple. Follow these steps to create your account and get your website tracking data.
Step 1: Create a Google Analytics Account
First, you need a Google Analytics account. This account acts as a container for all the websites (or "properties") you want to track.
- Navigate to the Google Analytics website.
- Click "Start measuring" and sign in with your Google account. It's best practice to use a professional Google account associated with your business rather than a personal Gmail account.
- On the "Account creation" screen, you'll need to enter an Account name. This is typically your business or organization's name.
- Review the data sharing settings and decide what you want to share with Google. Click "Next."
Step 2: Create a GA4 Property
A "property" represents your website or app. Inside your account, you can have multiple properties (e.g., one for your main website, one for your blog, one for your mobile app).
- Enter a Property name. This should be the name of your website (e.g., "My Awesome Business Website").
- Select your reporting time zone and the currency your business operates in. These settings are important as they affect how data is reported.
- Click "Next" to provide some basic business information. This is optional but helps Google tailor your experience.
- Accept the Google Analytics Terms of Service.
Step 3: Set Up a Data Stream
A data stream is the source of data for your property. It's the pipeline that connects your website or app to your GA4 property so that data can flow in.
- After creating your property, you'll be prompted to "Choose a platform." Since you're setting up a website, select "Web".
- Enter your website's URL (e.g., www.mybusiness.com) and give the stream a name (e.g., "Main Website Stream").
- Ensure Enhanced measurement is turned on. This is one of the best features of GA4 and will automatically collect data on page views, scrolls, outbound clicks, and more.
- Click "Create stream."
Once you create the stream, you'll see a screen with your stream details, including a critical piece of information: your MEASUREMENT ID. It will look something like this: G-XXXXXXXXXX. You will need this ID for the next step.
Step 4: Add the GA4 Tag to Your Website
Now that your property and data stream are ready, you need to add a small snippet of code (the GA4 tag) to your website. This tag is what actually collects the data and sends it back to Google Analytics. You have a few options for this step, from easiest to most technical.
Option A: Use Google Tag Manager (Recommended)
Google Tag Manager (GTM) is the most flexible and robust way to manage tracking tags on your site. If you're not using it already, now is a great time to start.
- In your Google Tag Manager Account, create a new Tag.
- For the "Tag Configuration," choose the "Google Analytics: GA4 Configuration" tag type.
- Paste the MEASUREMENT ID you copied from your GA4 data stream into the corresponding field.
- For the "Triggering" section, select the "All Pages" trigger. This tells GTM to fire the GA4 tag on every page of your website.
- Save your tag, and then click "Submit" to publish your changes.
Option B: Use a Website Builder or CMS Integration
Many platforms like WordPress, Shopify, Wix, and Squarespace have built-in integrations or plugins that make installing GA4 incredibly easy.
- For WordPress: You can use a plugin like Google's official Site Kit or other popular analytics plugins. You will typically just need to connect your Google account or paste your MEASUREMENT ID into a field in the plugin's settings.
- For Shopify: You can add the GA4 tag through the Online Store > Preferences section in your Shopify admin.
Check the documentation for whichever platform you use. Most offer a simple copy-and-paste solution where you only need your Measurement ID.
Option C: Add the Tag Manually to Your Website's Code
If you're comfortable editing your website's code, you can install the tag manually. From your GA4 data stream details page, you'll see an option to view the "Global site tag (gtag.js)."
Simply copy the entire code snippet and paste it immediately after the opening <head> tag on every single page of your website. If you're using a template or theme, you can often add this to a single header include file that is used across all pages.
<!-- Google tag (gtag.js) -->
<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>Scenario 2: Moving from Universal Analytics to GA4
If you have an existing Universal Analytics property (with an ID starting in "UA-"), you must create a new GA4 property. Your old UA data cannot be transferred to GA4, but Google provides a tool to help you get the basic setup copied over.
Step 1: Launch the GA4 Setup Assistant
- Log in to your Google Analytics account and navigate to the Admin section (the gear icon in the bottom-left).
- Make sure you have your existing Universal Analytics account and property selected.
- In the "Property" column, the very first option should be "GA4 Setup Assistant." Click it.
Step 2: Create Your New GA4 Property
The Setup Assistant will walk you through the process.
- Under "I want to create a new Google Analytics 4 property," click the "Get Started" button.
- A pop-up will explain what the wizard will do. For most users, you won't need to change any settings. It will automatically create a new GA4 property, copy some basic settings from your UA property (like the name, URL, and time zone), and activate enhanced measurement.
- Click "Create and continue."
The assistant will now create your new GA4 property for you. When it's finished, you can click "See your GA4 property" to be taken to its setup screen.
A VERY Important Note: The Setup Assistant does not automatically install the GA4 tracking tag on your website. After the assistant runs, you must still follow Step 4 from Scenario 1 above (using GTM, a plugin, or manual code) to get the new GA4 tag (with its new "G-" Measurement ID) on your site so it can start collecting data.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
How to Verify GA4 is Working Correctly
After you've installed the tag on your site, you’ll want to confirm it's working. The easiest way is to use the Realtime report in GA4.
- Navigate to your new GA4 property.
- In the left-hand menu, go to Reports > Realtime.
- Open your website in a new browser tab or on your phone and start navigating around.
- Within 30-60 seconds, you should see your own activity appear on the Realtime report. If you see yourself in "Users in Last 30 Minutes," you've successfully installed GA4!
If nothing shows up after a few minutes, re-check your steps. The most common issues are an incorrectly copied Measurement ID or forgetting to publish changes in Google Tag Manager.
Final Thoughts
Setting up Google Analytics 4 is a foundational step for gaining meaningful insights into your website's performance and audience behavior. Whether starting fresh or making the necessary switch from Universal Analytics, installing the GA4 tag is your starting line for modern, privacy-aware data collection.
Once your data is flowing into GA4, the next challenge is turning all those numbers and events into clear, actionable insights. Understanding complex reports can be a huge time-sink. We created Graphed to solve exactly this problem. Instead of wrestling with GA4's interface, you can connect your analytics account to our platform and create dashboards or ask questions in plain English - like "show me my top traffic sources that led to a conversion last month." We help you get straight to the answers you need, saving you hours and empowering your entire team to make data-driven decisions.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.