How to Set Up Google Analytics 4

Frame 18

Lucia Pons

May 05, 2023

How to Set Up Google Analytics 4

Many of you might be having a hard time switching from Google Analytics (Universal Analytics) to GA4, but it is necessary, especially since Google will officially sunset GA in July 😥!

GA is going to stop processing data soon, which means that if you don't configure GA4, you won't be able to have a history of your website 😲... We all use analytics to compare web traffic and events to the prior week, month, etc. Not having this valuable information can be a serious problem.

We know it will take a few hours to properly implement, but as soon as you leave it configured, you will definitely get the hang of it little by little.

You may have heard, and it's true, that GA4 is more complicated than GA 😤. It requires a bit more effort and technical knowledge to set it up and use it, but it’s nothing you can't handle 💪! Do you want to know more? Check here all the differences between GA and GA4.

Furthermore, Google, as usual, offers us tutorials to set up everything; nevertheless, we leave you with a summary as well, so you may make it all the easier for yourself. Let's take it one step at a time:

Step 1: Create a Google Analytics 4 Property

To begin, create a new property in Google Analytics 4.

Access the Admin section of your Google Analytics account and select "Create property" in the "Property" tab. Follow the basic instructions to complete the configuration. Here are the steps provided by Google’s own support page.

GA4 step 1. Analytics property.PNG

If you use another third-party application, you will also have to do the process again. Here is the guide.

Watch this YouTube video if you prefer a visual guide:

Step 2: Add Your Tracking Code

After setting up the GA4 property, add the tracking code to your website.

The code can be found in the "Data Streams" tab of the Google Analytics property 4. Once copied, it should be added to both the property and the header section of each page of your website.

For this, we recommend using Google Tag Manager, a free tool that allows you to track user behavior (such as page views, clicks, form fills, or purchases) on your website or app by easily adding tracking tags (no editing the web code!).

Google Tag Manager.PNG

If you are not yet using GTM, here is a quick guide:

  1. Create a Google Tag Manager account.
  2. Set up your container. A container is a code snippet that you add to your website or app to enable GTM.
  3. Add the container code to your website or app. You can add the code to your website's HTML or via a tag management plugin.
  4. Create your first tag. Tags are snippets of code that track user behavior, such as clicks, form submissions, or page views.
  5. Preview and test your tags before publishing your tags in GTM to ensure they're working correctly.
  6. Publish your tags and start tracking user behavior on your website or app.

FYI: For those of you using WordPress as your CMS, there is a user-friendly plug-in called Google Site Kit, which can also install your GA4 code to the website.

Step 3: Configure Your Data Streams or Events

We have reached the most complex point of GA4 setup🤘! This no longer requires a technical part, but rather rolling up the sleeves to detect all the relevant events we want to track 👣.

First, we will have to see which data sources we want to track: website traffic or the use of a mobile application. Another option is to set up a website as a blog independently to keep track of other metrics.

Obviously, the type of business you have will determine the metrics you want to track. An e-commerce site will be more focused on sales, revenue, or cart abandonment, a SaaS website will focus on engagement, user retention, customer lifecycle, etc.

Thus, the metrics you define should be a reflection of your KPIs, your goals, and your objectives.

How to define these metrics?

  1. Define your KPIs aligned with your OKRs or business objectives. For example, if one of your objectives includes increasing sales through the web, one of your metrics will be the conversion rate, bounce rate, and probably session duration.
  2. Analyze your target's behavior. If your website is focused on an audience that interacts with social networks, you will probably want to analyze the traffic coming from these channels or mobile users specifically. For this, it’s helpful to keep in mind your buyer persona!
  3. Evaluate your marketing channels. List all the marketing channels that can bring traffic to your website and the metrics that are relevant for each of these channels. For example, if you manage Google Ads search campaigns, you probably want to track metrics, such as: cost per click, click-through rate, and conversion rate.
  4. Map your customer journey. Knowing the path your customer follows will allow you to identify metrics that will help you optimize each stage. This can include session origin, landing page performance, and funnel conversion rates.
  5. Use data-driven insights. This can be with either Gretel or GA4. Once you have it set up, it is interesting to analyze trends to refine the defined metrics and find new ones!
Gretel insights from website.PNG

Let's see some examples of metrics that we could create in GA4:

Acquisition Metrics: To understand how users are finding your website or app.

  • Tags per campaign: we can use Google Tag Manager to identify the campaigns that bring traffic to our website.
  • Source: this is already predefined, but it gives us an idea of the origin of the campaign.

Engagement Metrics: To understand how users are interacting with your website or app.

  • Bounce Rate: The percentage of users who leave your website or app after viewing only one page.
  • Scroll +50%: To count when a user scrolls more than 50% of your page.

Behavioral Metrics: To understand how users are navigating your website or app and interacting with your content.

  • Content Download: For when a user clicks and downloads relevant content from your website.
  • Cart Abandonment Rate: The percentage of users who add items to their cart, but do not complete the purchase.

Retention Metrics: To help you understand how often users return to your website or app over time.

  • Churn Rate: The percentage of users who do not return to your website or app after their first visit.
  • Lifetime Value: The total value revenue generated by a single user over the course of their engagement with your website or app.
marketing metrics image article performance metrics

Once we have these events listed, we have to configure them:

  1. Go to your GA4 Property and navigate to the "Events" section.
  2. Click on "Create Event" to define a new custom event.
  3. Assign a name to your event, and define the parameters you want to track. You can define up to 25 custom parameters for each event.
  4. Save your custom event.
  5. Use Google Tag Manager to implement the event tracking code on your website or app (with help from your development department!).
  6. Test your event tracking to make sure it works properly.

Step 4: Set Up Conversion Tracking

This part interests almost all of us! Dough is dough! 🤑

You can set up all the events that you consider relevant to your company as a business: completing a purchase, filling out a form, or subscribing to a newsletter, for example.

The main difference between an event and a conversion is that conversions will allow you to measure how users interact with this type of event (and get to the main objective).

Some examples of conversions could be:

  • Purchase: When a user completes a transaction on your website or app.
  • Lead: When a user submits a form or signs up for a newsletter.
  • View Item: When a user views a specific product or item on your website or app.
  • Add to Cart: When a user adds an item to their cart.
  • Begin Checkout: When a user starts the checkout process.
  • Sign Up: When a user creates an account on your website or app.
  • Search: When a user performs a search on your website or app.
  • Page View: When a user views a specific page on your website or app.
  • Scroll: When a user scrolls a certain percentage of a page on your website or app.
GA4 Step 4. conversions.PNG

To define these conversions, you will go to the "Conversions" tab in your property settings. When defining an event, you will be able to add relevant information about it, such as:

  • Conversion Value: The monetary value. For example, the total revenue generated by that purchase.
  • Conversion Time: The amount of time it takes for a user to complete a conversion event after first interacting with your website or app. This metric can help you understand the user journey and identify any obstacles that may be preventing users from converting.
  • Conversion Source: The source of the conversion event, such as organic search, paid search, social media, or referral. This metric can help you understand which channels are driving the most conversions and optimize your marketing efforts accordingly.
  • Conversion Location: The geographic location of the users who are completing the conversion event. This metric can help you understand where your most valuable customers are located, and then you can tailor your marketing efforts to those regions.

Step 5: Customize Your Reports

One of the final steps is the configuration of reports. This is optional, as many people use Looker Studio (the previous Google Data Studio) for this kind of report or other paid tools, but we recommend testing at least one report.

If you also want to go further and do an Exploration, see our guide to find out how to do it step by step.

GA4. Step 5 create explorations.PNG

Reports in GA4 allow many edits, here is a list of the most common ones to get you started:

  • Adding or removing metrics / dimensions. Dimensions are attributes that provide additional information about your metrics, such as the source of your traffic or the location of your users.
  • Applying filters. For example, filter out traffic from your own IP address or include only traffic from a specific location.
  • Creating custom segments. Analyze specific subsets of your data, such as users who completed a specific conversion event or users who visited a specific page on your website.
  • Using visualization tools. Charts, graphs, and tables will help you better understand your data and communicate insights to others.

Step 6: Verify Tracking 🧐

Before closing: validate that everything is being tracked correctly! This may take a few days or weeks but set an alarm for the next few days to verify that everything is being tracked and that no metric is zero.

To make it simple, it is best to do a fake test and interact with your own website / CTAs, and in parallel, have the "Real Time" section of your GA4 property open while checking that the information of the events you do and conversions appears!

GA4 Step 5. Verify your tracking.PNG


We know that configuring a new tool, even if it is GA4, is a challenge for many 🤕, but it is a small step that we have to do as soon as possible to start having all the data in this new tool. Surely, we will end up knowing it like the back of our hand in no time!💪

One you've setted GA4, see what Gretel can do for you!

Do you already use Google Analytics 4?

Then integrate Google Analytics 4 with Gretel and start receiving insights!