How to Set Up Google Analytics 4 for Your Website : A Detailed Guide

Google has announced that on July 1, 2023 they will be retiring Universal Analytics, the current version of Google Analytics, and it will stop processing new data on that date. Google Analytics 4 will replace Universal Analytics as the Google analytics tool to collect website and app data.

You should set up Google Analytics 4 now to begin collecting data from your website before Universal Analytics is shut down. During this transition period, it is best to set up Google Analytics 4 to run in parallel with Universal Analytics until it is retired.

The transition to Google Analytics 4 has raised a lot of questions. In this post, I provide a detailed step-by-step guide to help with setting up Google Analytics 4 for both new and existing Analytics accounts.

What is Google Analytics 4?

Google Analytics 4 (GA4) is the newest version of Google Analytics. It is a completely event-driven analytics tool that enables you to collect data to measure the traffic and performance of your websites and apps. These data insights help you to make improvements to your marketing strategy and website performance.

Google Analytics 4 was introduced in October 2020. It is still in Beta and Google continues to add new features to it.

Why do I need to set up Google Analytics 4?

Google is soon retiring the current version of Analytics which is called Universal Analytics (UA) or Google Analytics 3. Universal Analytics will stop processing new data in standard properties beginning July 1, 2023.

Here is the Google Announcement from the Analytics dashboard:

Universal Analytics will no longer process new data in standard properties beginning July 1, 2023. Prepare now by setting up and switching over to a Google Analytics 4 property.

If you have an existing Universal Analytics account, you should set up Google Analytics 4 (GA4) in your account now to begin collecting data in parallel with Universal Analytics.

When Universal Analytics stops processing data on July 1, 2023, you will have Google Analytics 4 set up and running. You will also have access to a year’s worth of data for a year over year comparison of data for your website or app on GA4.

Google Analytics 4 is the only option available for new Google Analytics accounts. Universal Analytics is no longer available to set up in new accounts.

How is GA4 different from Universal Analytics?

Google Analytics 4 is different from Universal Analytics because it works across both websites and apps. It is more privacy-focused and completely event driven.

Here are some of the changes in GA4:

  • GA4 is completely event-driven.
  • It collects both website and app data across the customer journey.
  • It has more privacy controls like cookie-less measurement.
  • It has better cross-device tracking.
  • Pathing analysis is improved.
  • Funnel visualization analysis is improved. It uses a funnel analysis tool that was previously available only to enterprise users.
  • Advanced users can import all data to the cloud using BigQuery.

How do I set up Google Analytics 4 on my Website?

In this GA4 guide, we walk you through the steps for setting up Google Analytics 4 for both existing Analytics accounts and new accounts.

I. To begin setting up GA4 in a new Analytics account

If you are setting up a brand new Google Analytics account, the only option available to you is Google Analytics 4.

Go to analytics.google.com to set up your account
1. log in with a gmail account
2. Click on “Start Measuring”

Google Analytics start page for new accounts

Google Analytics start page

3. Under Account setup, enter your Account name.
4. Select the Account data-sharing settings.
5. Click Next.
6. Then follow the steps listed under III – GA4 Property Setup for new and existing accounts.

Google Analytics Account Setup Page

Google Analytics Account Setup Page

II. To begin setting up GA4 in an existing Universal Analytics Account

Go to analytics.google.com
1. log in with a gmail account
2. You will see your existing analytics data from Universal Analytics.

Home Page for existing Google Analytics accounts

Google Analytics Home page for existing accounts

3. Click on Admin in the left dashboard at the bottom.
4. Click on “Create Account”

Create new account screen in Google Analytics

Create account screen in Google Analytics

5. Under Account setup, enter the Account name.
Since you already have a UA account, set up your new account name with GA4 in the title to tell which account you are viewing. For example as “business name – GA4”
6. Select your Account data-sharing settings.
7. Click Next.
8. Then follow the steps listed under III – GA4 Property Setup for new and existing accounts.

III. GA4 Property Setup for both new and existing Analytics accounts

Once you get to the Property setup, these steps are common to both new and existing accounts.

1. Property setup
GA4 allows you to set up both web and app data in property settings.

Under Property Settings,

> enter Property name (your website URL or business name)
> enter Industry category
> enter Reporting time zone
> enter Currency
> Click Next

Google Analytics 4 Property Settings page

GA4 Property Settings Page

2. Business Information.
In “About your Business”,

> Enter your business information

  • Industry category
  • Business size
  • How you intend to use Google Analytics for your business

> Click Create
> Accept Google Analytics Terms of service
> Click Accept

Google Analytics 4 Business Information Page

GA4 Business Information Page

3. Data stream setup.
Setup the data stream to start collecting data.

You have 3 options here
> Web
> Android App
> IOS APP

GA4 datastream selection page

GA4 datastream selection page

4. Web data stream setup

To set up a data stream for a website, select “Web”,
> enter the website URL
> enter stream name
> set enhanced measurement to Yes.
> Click “Create Stream”

Google Analytics 4 data stream setup page

GA4 data stream setup page

5. Web stream details
You will now get the Web Stream Details page with the Stream Name, URL, measurement ID and tagging instructions.

GA4 Web stream details page with site tags

GA4 web stream details page with site tags

Your GA4 account has been created in Analytics! (But your work is not done. You will now have to add the GA4 tags to your website for Analytics to work).

To install Google Analytics 4 on your website, the GA4 tag provided in the tagging instructions of the web stream details page needs to be installed on every page of your website for Google Analytics to begin collecting data. Without the GA4 tag on your website, Google Analytics 4 will not be able to collect data.

There are a couple of options to install the GA4 tag on your site which are discussed below.

Installing the Google Analytics 4 Code on your website

For Google Analytics to begin collecting analytics data from your site, the GA4 tag code provided on the web stream details page has to be added to every page of your website in the head section of the html code to begin tracking.

There are a few options to add the tag to your site:

1. Manually add the GA4 site tag to site code

To manually add the site tag to your website, you will need to have access to the html code on your site. This method will work for a smaller site with few pages.

A. Copy and Paste the code on all web pages

1. Click on “Add new on-page tag” on the Web stream details page.
2. Click on Global site tag (gtag.js).
3. Copy all the code for the global site tag.
4. Paste the code into the html head section of every page of your website.

GA4 global site tag to add to website

GA4 global site tag

B. Test to see if the GA4 tag is installed on your web page

1. Copy your GA4 measurement ID from web stream details, this is the number that begins with a G-.
2. After you add the GA4 tag code to all your web pages, check the page source of your web page for the GA4 measurement id.

  • Use a developer tool to view the source code of your web page.
  • Go to networks.
  • Search for your measurement id ‘G- ‘.
  • If you see your measurement ID in the page code, your GA4 tag is on your page.

3. After your GA4 tag is added, visit your site and then check under Realtime reports in the GA4 dashboard

  • See if your visit is spotted. This may take a few minutes to show.
  • If you see your visit in Realtime, your website is successfully connected to Google Analytics 4 and will begin tracking site visitors.
GA4 realtime report

GA4 realtime report

2. Use Google Tag Manager to add the GA4 site tag (recommended method)

This is the recommended method of implementing the GA4 tag. GA4 tags are built into GTM and this makes it easier to add the GA4 tags to your website.

If you already have Google Tag Manager set up for your website, this is the easier method especially for large sites.
If you need to set up and install Google Tag Manager, read this post.

1) Copy the GA4 measurement ID “G- ” from the web stream details page.
2) Go to Google Tag Manager at tagmanager.google.com
a) Sign in
b) Select the container for your website
c) Click on “Add a New Tag”

Global Tag manager screen to add new tag

Global Tag manager screen to add new tag

3) Enter the details for the new tag
a) Tag type: select GA4 configuration
b) Measurement ID: enter your measurement ID G-.
c) Triggering: Select “All Pages”
d) Name the tag: GA4 Base Tag
e) Save
f) Submit and publish it to your site

Global Tag Manager GA4 configuration tag

Global Tag Manager GA4 configuration tag

4) Test if the GA4 tag is on your site. There are a couple of different options to test if the tag is on your site.
Visit a page on your site and scroll down,
a) Open a new browser window, go to your Google Analytics 4 dashboard,

  • Go to Reports > Realtime
  • Check if your visit is spotted on Realtime reports, this may take a few minutes.

The image will be similar to the Realtime Reports Image above.
b) On GTM, you can test the tag with Preview and Debug mode.
This article from Google provides more information on how to use preview and debug mode,
c) check the page source of your web page for the GA4 measurement id.

  • Use a developer tool to view the source code of your web page.
  • Go to networks.
  • Search for your measurement id “G- “.
  • If you see your measurement ID, your GA4 tag is on your page.

Conclusion

Once you have Google Analytics 4 set up correctly on your website, GA4 will begin to collect data about website visits and performance.

You should continue to run Universal Analytics to collect data in parallel with GA4. When Universal Analytics is shut down in July 2023, you will have a year’s worth of data in GA4 to use for a YOY comparison.

GA4 is still in Beta and Google is continuing to add new features and functionality. Since GA4 reports are different from Universal Analytics, it is best to get started now with collecting data and getting familiar with the new GA4 platform.

We hope you found this article helpful to set up GA4. Check back soon for follow-up articles on Google Analytics 4.

If you need help with Google Analytics 4, please reach out and we will be happy to help.

Need Help with Digital Marketing and Google Analytics?

Gold Mango Design LLC. helps businesses succeed with digital marketing strategies. Our digital marketing services include Google Ads PPC (Pay per Click) Marketing & Management, Search Engine Optimization (SEO), Local SEO, Mobile-Friendly Web Design & Web Development, Google Analytics, Digital Marketing consulting and more. We are located in Plano, TX right outside Dallas and serve customers in the USA. Contact us at https://goldmangodesign.com

Related Articles on Google Analytics & SEO