MeasureSchool logo

The Google Analytics 4 Tutorial for Beginners

Did you know that after July 2023, your Universal Analytics property will no longer process new hits, and would eventually be inaccessible?

With less than a year (a bit longer for 360 properties) left before it gets replaced, digital marketers need to get used to the new Google Analytics 4 as soon as possible to not be taken aback by this change.

Google Analytics 4 is Google’s newest tracking tool. It’s a completely new and separate system, rather than an upgrade to Universal Analytics. 

GA4 For Beginners

Master the basics with our FREE GA4 Course for Beginners

Whether you’re experienced or new to using Google’s analytics service, you should start with learning the basics to implement your tracking goals properly.

In this Google Analytics 4 tutorial, you’ll learn what GA4 is all about and how you can use it to measure traffic and engagement across your websites and apps.

Here’s an overview of what we’ll cover:

Let’s jump right in!

What is GA4 and Why Should You Use It?

Google Analytics 4 (GA4) is a free analytics platform that analyzes your websites & apps.

GA4 provides increased flexibility by using an event-based model (so that common interactions can be tracked natively), including privacy controls, predictive capabilities and integrating with media platforms and datawarehouses like BigQuery.

Google Analytics 4 is the newest analytics service provided by Google. The presumption of it being an upgrade to Universal Analytics is inaccurate because GA4 is a completely different tool with its new data model.

Device support for both websites and mobile apps has also been added along with new views for reporting data. Read more on the biggest changes in Google Analytics 4 to know how GA4 changes the way we think about analytics.

With the sunset of UA approaching fast, it’s no longer a matter of deciding if GA4 is worthwhile switching to or using it in tandem with UA because eventually, it will replace UA. It will become the default property when making a Google Analytics account.

Google Analytics 4 is unlike anything you may know from your previous Google Analytics experience, but its improvements, added flexibility, and perspective on analytics will help you better understand the new digital world.

🚨 Note: If you’re interested in the use cases of GA4, check out this guide where we go deeper into that topic.

What is the Goal of GA4?

Whether your business is doing well or in a precarious situation, increasing revenue will always be one of its goals. 

Aside from ensuring the quality of your service or product, one of the most effective and important ways of growing your business is to know and understand your users. 

Data on your users is like gold for marketers, and the GA4 tool is the shovel that will help you get that gold. If you know what users are doing on your website, you can optimize its content to attract more of them and ultimately increase your profits.

How Google Analytics 4 Works

Working with Google Analytics 4 can be divided into three aspects: measuring, reporting, and analyzing.

Let’s dive into the first aspect, measuring, by looking at an example.

After creating an account, there are two options for implementing a snippet of code to your website. You can either use the Global site tag (gtag.js) or Google Tag Manager.

Tagging options for connecting GA4 to a website

This JavaScript code will be responsible for connecting your website to Google Analytics behind the scenes. Once you have it installed, data will flow into your GA4 account.

Google Analytics 4 even allows you to check what is happening on your website in real-time.

GA4 real-time overview

For this step, information about your users, like where they come from, what page they are currently on, and what are they clicking on becomes data points that GA4 measures.

After measuring data about your users, the next step is reporting.

Google Analytics 4 provides multiple pre-built reports that you can use to view the data from your website and apps. Let’s look at a few of these reports!

The acquisition reports allow you to check how your users are arriving at your web page. 

Sample acquisition overview report

Data on how users interact with your web page can be seen in the engagement reports.

Sample engagement overview report

You can also see information about your users like their location, age, and interests by looking at the demographics report.

Sample demographics overview report

These are only some of the reports you can check out. For each category, you can still go deeper and see more specific data that might be helpful to you. 

Aside from what Google provides, you can also build custom reports to view the information you care about. 

While the data itself is important, the most valuable thing is to dive deeper – what can you do with this data? Well, the last aspect of the GA4 workflow, analyzing, uses the gathered data to help answer questions you may have about your users.

When you want to analyze data further, Google’s BigQuery may come to mind, especially if you’re working with a large dataset. Another way to look further is to utilize the helpful feature that comes with your GA4 property called explorations.

Explorations are a set of powerful audience discovery and comparison tools that go beyond standard reports to help you uncover deeper insights into your customers’ behavior.

Explorations tab in GA4

There are multiple templates to choose from, each one providing you with different ways to find the answers to very specific questions about your users. 

Looking at a funnel exploration example, you can see the different steps users take in making a conversion.

Sample funnel exploration

The user journey is broken down into steps and you can analyze each in detail. In the example, the user views a product, adds it to the cart, provides details, and then buys it. You can also see how many users leave at each step.

After obtaining additional information like this, the last step would be to turn those insights into actions. Maybe, you’ll start with some A/B testing or completely change the way you present your website/app content.

Whatever action you may take, GA4 is still there to let you know if those changes had a positive, negative, or inconsequential impact on your business. You can keep using this tool to optimize your content, and ultimately increase your revenue.

What we’ve covered only touches the surface of the capabilities of Google Analytics 4. It is a powerful tool that gives you valuable insights about your users simply and easily.

Now, let’s start with learning how to set up Google Analytics 4 so that you can dive deeper into its implementation.

How to Set Up Google Analytics 4

Setting up Google Analytics 4 seems deceptively easy. Simply follow the instructions Google provides, and you’re ready to start tracking different user interactions across your websites and apps.

There may be some who can handle setting up GA4 that way, but there are surely some others who can get lost with the provided instructions. 

Several nuances need to be taken into consideration, and some of these steps are not as intuitive as one may think, especially for those implementing GA4 for the first time.

It’s important to follow the best practices for setting up GA4.

However, no need to worry as we’ll guide you through the first steps so that you can start your Google Analytics 4 journey.

Creating a GA4 Account

This section will explain the steps for creating a Google Analytics 4 account for first-time users. 

🚨 Note: If you use Universal Analytics and are migrating to GA4, we have a handy GA4 migration guide that you should first check out. We have listed out all the steps you need to take, from preparation and planning to implementation and handling of data.

Since you cannot transfer historical data, the best way forward is to link the GA4 account to your existing UA property. You may not be able to access previous data in your UA property, but you will be able to import your UA tracking configuration into your GA4 property. 

Check out our guide on upgrading to Google Analytics 4 to link your UA property using the GA4 Setup Assistant. Here, you’ll simultaneously create and link a GA4 account from your UA property.

Now, let’s create a new Google Analytics 4 account.

For this demo, we already have an existing account, but you can create another one from the Admin settings. If you’re using Google’s analytics services for the first time, the starting steps may be different, but you will eventually arrive at the same place.

Go to Google Analytics. Click on Admin Create Account

Creating a new Google Analytics account

The first set of settings you need to configure is the account setup. Type in an Account name.

Specifying an account name

Next, you can configure the account data sharing settings. 

Select the ones you choose to share. After this, click on Next to finish the account setup.

Finishing account setup

The next step is the property setup. By default, a Google Analytics 4 property will be created.

Provide a Property name, then specify the Reporting time zone and equivalent Currency. Finally, click on Next.

Property set up in GA4

The last step in creating an account is to provide information about your business. 

Tick the options that apply or skip this part if you want to. Then, click on Create.

Finalizing account creation in GA4

Lastly, check the box to agree to the terms of service agreement, then click on I Accept.

Accepting Google Analytics terms of service agreement

On your Google Analytics admin settings, there are two columns on the Account and Property settings.

Account and property settings in the admin section

The first column contains the settings related to your account. You can also switch to other accounts from here. For a single email address, you can create up to 100 accounts.

An instance where this could make sense is when you have unrelated businesses. You can create an account for each business without logging in to a different email address.

On the other hand, the second column has the settings related to your web page or application. Similarly, you are allowed to own multiple properties in a single account, up to 50 properties for each account.

Setting up a Data Stream

Now that you have a Google Analytics account and a GA4 property, let’s set up a data stream to specify where you want to obtain data from.

There are 3 types of data streams: Web (for websites), iOS (for iOS apps), and Android (for Android apps). We’ll be working with a web page for this demonstration, so we will use the Web data stream. 

From the property settings, click on Data Streams Web.

Creating a web data stream

Enter your website URL, then provide a Stream name. Finally, click on Create stream

Setting up the web data stream

By default, enhanced measurement is activated. It allows GA4 to track some events automatically. These include pageviews, scrolls, clicks to external web pages, searches within your site, videos your users watch on your web pages, and downloads from your site.

🚨 Note: If you want to find out more about tracking embedded YouTube videos on your website, check out our handy guide.

Now that you have an account and data stream, the next step is to connect Google Analytics 4 to your website and dictate what data should be sent.

Connecting GA4 to your Web Page with GTM

As mentioned in the GA4 overview earlier, there are two ways of implementing GA4 on your website – using the Global site tag (gtag.js) or Google Tag Manager.

We’ll use GTM as it gives more flexibility when it comes to tracking. 

Before proceeding, ensure that GTM is set up and properly connected to your web page. If you don’t have a GTM account yet, check out our Google Tag Manager tutorial to install GTM on your website.

First, copy the Measurement ID from the web stream details.

Copying the measurement ID

The measurement ID will help Google Analytics know that data should flow to this specific property and stream.

In Google Tag Manager, go to TagsNew.

Creating a new tag

Click on Tag ConfigurationGoogle Analytics: GA4 Configuration.

🚨 Note: The GA4 configuration tag has been replaced with the new Google Tag.

Creating a GA4 configuration tag

Paste the measurement ID in the space provided, then click on Triggering

Pasting the measurement ID and selecting a trigger

Select the All Pages trigger.

Selecting all pages trigger

Provide a name for the tag, then click on Save.

Naming and saving the tag

Click on Submit to make the changes live. 

Submitting a live version to the website

Click on Publish.

Publishing the GA4 configuration tag

Now go to your website and refresh the page. 

Using the Tag Assistant Chrome extension, you can see the global site tag on the tag analysis. This means that you have successfully implemented Google Analytics 4 on your website.

Global site tag in the tag assistant chrome extension

The Tag Assistant extension gives you a quick and easy way to gain insights from Google Tag Manager. Check out our list of the essential analytics Chrome extensions to know about other helpful extensions you should use to work smarter with Google Analytics.

While the GA4 global site tag showing in the Tag Assistant extension is already a good sign, checking Google Analytics is the definitive way to check if GA4 has been implemented correctly. 

Go to Reports Real-time. Here, you can see that our session has been recorded and we have been considered the first user on the web page.

User recorded in Google Analytics

Google Analytics 4 is running properly and data is flowing into your account. 

To ensure that your setup is efficient, check out our guide on GA4 audit: questions to ensure correct account setup.

How to Create GA4 Events with GTM

When Google Analytics 4 was introduced, it was announced as an event-based analytics tool where everything can be considered an event.

This provided more versatility as you could now decide if a pageview, purchase, or any other action taken by a visitor on your website was something you are interested in tracking. 

Creating and tracking GA4 events has been made simple with the help of Google Tag Manager. Before making your custom event, let’s first determine the differences between GA4 event types.

GA4 Event Types

There are four event types in Google Analytics 4. Two types are collected automatically and the other two require some implementation to see them in Analytics.

Automatically collected events are the basic events that come together with your snippet. Google Analytics collects them by default when you set up Google Analytics 4 on your website or app.

Next, we have the enhanced measurement events, which were briefly covered while setting up a data stream. 

Enhanced measurement events in web stream details

You can toggle the entire enhanced measurement events collection on or off by accessing the stream details on your GA4 property.

To select which specific events you wish to track, click on the gear icon at the bottom right.

Enhanced measurement settings

Here, you are given a full description of each event under this event type and the ability to specify which events you wish to track.

List of enhanced measurement events

Next, we have the recommended events. These are the events that you implement but have predetermined names and parameters.

If you have an event you wish to track, it is recommended to first check the recommended events article provided in the Analytics Help to unlock reporting capabilities. Here, you will find the predetermined names and links describing the prescribed parameters for each event.

For example, if we want to track an add-to-cart event, click on the add_to_cart link in the For online sales section of the article.

Add to cart recommended event

This link leads you to a Google Analytics developers page where the prescribed parameters are listed and explained in great detail. These parameters are additional data points that help describe the event.

Google Analytics developers page for the recommended add-to-cart event

The last event type is the custom events. These are the events that you define. If you’re trying to track an event that is not on the list of recommended events, you can implement a custom one with your own corresponding set of parameters. 

Note that these custom events will not appear in most standard reports, so you will need to set up custom reports or explorations for a meaningful analysis.

Implementing a Custom Event in GA4 with GTM

Let’s create a custom event in Google Analytics 4 with the help of Google Tag Manager.

First, determine what event you want to track. 

For this example, let’s track a specific link that redirects the user to a web page with reviews for the product.

Link to be tracked

Before any implementation, go to Variables and ensure that all click variables are activated.

Click variables in GTM

If your click variables are not yet activated, click on Configure and select all click variables.

Configuring built-in variables

Now, let’s click on Preview

Opening the preview mode

Click on Connect.

Connecting Tag Assistant to the site

On the tab connected to the Tag Assistant, click on the link you want to track.

Opening the link to be tracked

Go to the Tag Assistant and select Link Click. Since this example is aimed at tracking link clicks for all reviews, the click classes variable is the most appropriate for the tag. Copy this value.

Copying the click classes value for the link click

Going back to Tag Manager, click on TriggersNew.

Creating a new trigger

Click on Trigger ConfigurationJust Links

Just links trigger configuration

We only want to track a specific link, so select Some Link Clicks. Specify the condition as Click Classes contains as the click classes value.

Trigger configuration for specific click classes

Provide a name for the trigger, then click on Save

Saving the link clicks trigger

Now, you can create a tag for your custom event.

Go to TagsNew

Creating a custom events tag

Click on Tag ConfigurationGoogle Analytics: GA4 Event.

Creating a GA4 event tag

Select the GA4 configuration tag you have previously set up, then provide an event name.

Connecting to the configuration tag and providing an event name

Next, click on Event ParametersAdd Row

Adding a new event parameter

Provide a parameter name, then click on the lego piece icon under the value.

Providing custom parameter details

Select the Click URL variable.

Selecting the click URL variable for the parameter value

Next, click on Triggering.

Creating a trigger for the custom GA4 tag

Select the custom trigger you created for the custom link clicks.

Selecting the custom review link trigger

Finally, select a tag name and click on Save.

Completing the custom GA4 event tag

Selecting the right trigger and parameters for your custom events depends on the action you want to track. Our guide on button click tracking in GA4 may be helpful for some of your custom events.

Now, let’s test our tag.

Click on Preview again.

Entering the preview mode

On the website connected to Tag Assistant, click on the review link again.

Clicking on the review link

In Tag Assistant, you can see under the Link Click event that your custom event tag has been fired.

Successful firing of GA4 custom event tag

Let’s check if it has been recorded in Google Analytics.

Go to Configure DebugView. Here, you can see your review_link event. This means that your tracking has been set up correctly.

Custom event showing in Google Analytics debug view

Clicking on your custom event allows you to see the parameters you are sending along with this event. Here, you can see your reviewed_product parameter. 

Reviewed_product parameter 

If you want to see this parameter in your reports, it is important to register it as a custom dimension. Otherwise, it will not be available.

Creating a Custom Dimension

Click on Custom definitionsCreate custom dimensions.

Creating a custom dimension

Provide a Dimension name and Description. The scope of this dimension should remain as an event. 

Custom dimension setup

Next, you need to specify the event parameter. This should be the same as what was set up in GTM.

Let’s go back to GTM and copy the value directly to be sure that there is no mistake. 

Copying the event parameter name from GTM

Paste this name back to Analytics and click on Save

Completing the custom dimension setup

It might take up to 24 hours to appear, but you can view this custom dimension in your reports by going to Reports Engagement Events

Events engagement report

Don’t forget to publish your container by going to GTM and clicking Submit

Submitting the GTM container

Provide a version name and click on Publish.

Publishing a live version of the GTM container

Next, let’s discuss the ways of viewing data in Google Analytics 4 and the different reports Analytics provides by default.

Standard Reports in Google Analytics 4

Your Google Analytics property comes with multiple predetermined reports to help you analyze data from your website and apps.

Understanding the reporting interface of Google Analytics 4 will allow you to analyze this data properly and obtain valuable insights to better understand user activity.

For this section, you will be working with the Google Demo account so that you can view a property already populated with a large dataset. 

GA4 Home Overview

Opening your GA4 property directs you to a home section. This section gives you a summary of what is happening on your web page. 

GA4 home section

The first thing you see is a graph containing information about the total number of users, the number of new users, their average engagement time, and the total revenue generated. 

Trend lines showing data for the last seven days and the preceding period can also be seen, along with the positive or negative change between the two.

Reports snapshot graph in the GA4 home

Clicking on other metrics on this graph will show their corresponding trend lines.

Viewing other metrics in the reports snapshot graph

The second card is related to activity in real-time. You can see information about your users in the last 30 minutes and the top countries where these users are.

The real-time card in GA4 home

Scrolling down, you can see the recently viewed section that provides shortcuts to the most recent reports you have opened.

Recently viewed section

Further down is the most exciting feature of GA4, the Insights.

Google Analytics 4 insights

Insights are automatically provided through the use of machine learning to help you understand and act on your data. This feature detects unusual changes or emerging trends in your data and presents them in this section.

You can also create custom insights for the data that is important to you. Just provide conditions that will detect changes to see these insights. Luckily, you can create up to 50 custom insights per property.

Let’s now discuss the different reports in your GA4 property.

GA4 Reports

Click on the Reports tab present below the home tab.