What is a Segment in GA4?
A segment is a subset of data in Google Analytics 4 that allows you to divide your business data into smaller, more targeted groups. You can use segments for analyzing particular groups of your audience depending on specific criteria such as age and engagement rate.
Instead of looking at data from all users, you can analyze users from a certain region compared to others. In this case, creating segments will be useful since you may realize that website traffic from certain countries is more valuable and represents the majority of revenue for your company.
For example, you can create a segment for users from the US (with any country ID), and you can include various dimensions and metrics such as city and active users, as shown in the picture below.
Additionally, your segment can be based on another dimension, such as device category or event name. You have many options to include in your segment report.
How to Create Segments?
Creating segments in Google Analytics 4 is not the same as in UA. While you could find segments in most basic and custom reports in UA, you can do the same thing in GA4 by using comparisons.
However, using the exploration section in GA4 is quite effective than comparisons. So, we'll show you how to create all types of segments by using exploration reports in GA4.
GA4 provides two options for segment creation :
- Firstly, you can build segments from scratch by choosing custom segments .
- You can also use a reference and choose one of the suggested segments below.
Audiences vs. Segments
While both Audiences and Segments in GA4 are used to group users based on criteria, they're used for different purposes.
You may be confused about audiences and segments. Let me clarify it. You are able to build an audience based on a segment, but these two functions are different. Here are the most important differences :
- Audiences are supported in standard reports, but segments are only available in exploration reports.
- Audiences are not available in exploration reports.
- Audiences can be used for Google Ads remarketing campaigns. In contrast, segments in GA4 are used for data analysis and filtering within the GA4 interface but are not directly used for remarketing campaigns.
Custom Segments in GA4
When you start creating a new custom segment in Google Analytics 4, you have three types of segments:
- User segment includes all user data that meet particular criteria.
- Session segment includes data from all sessions that match the criteria.
- Event segment includes only specific events that meet the criteria.
Let me demonstrate how each segment works.
➤ First, let's take a look at user segments .
Assume a user visited your website and completed two sessions.
- During the first session, the user performed the following actions: one page_view event and one click .
- The next session, the same user did the following actions: one page_view , one add_to_cart , and one checkout .
Since we tell GA4 to include all data that belongs to the user, if we build a user segment with the condition that the user adds at least an item to a cart, it will contain all events data from both sessions.
What is the reason for this? The reason is that this user has attended at least one add_to_cart event. It means that the user segment will include all of that user's events during the date range you provide.
➤ If we create the session segment with the rule that the user goes through the checkout process during the session, it will just contain data from the second session (all events in the second session) because we told GA4 that it should only include data from sessions where the checkout event occurred.
➤ Finally, think about the event segment . If you create a segment with the event name begin_checkout , only events that match the exact condition will be included. In contrast to the session segment, we will only get one event, checkout . There will be no further events.
Here's a step-by-step guide to getting started with creating custom segments:
Go to Explore section in the left side menu.
Create a new exploration. In this guide, we will use a Free Form Exploration.
Under Variables, you will find all of the components that you can apply in the analysis: segments, dimensions, metrics, and more. Although the default list is not very extensive, you can build and add more segments by selecting the + icon.
To learn more about segment structure and audiences, you can find our detailed tutorial with examples.
Don't worry, as you continue reading, you will learn more about the segment options and conditions in detail.
Get to Know GA4 Segment Builder
You're looking at the segment builder in GA4 in the picture below. There are some cool features to know about within the segment builder, so let's review them together.
First and foremost, it's important to understand the OR & AND conditional logic operators. These operators allow you to apply combinations of multiple criteria simultaneously within the groups.
Add conditions
To add conditions, simply click on "Add condition group to include" and then start searching for the dimensions you need. As you begin typing, you'll see suggestions that you can choose from. In addition to including specific users or events, you can exclude them from a segment, either temporarily or permanently. However, it's important to note that a segment can only have one exclude group.
And guess what? If you're searching for users who have completed two events, regardless of the order, you can easily add another condition by clicking the AND button. If a user meets any of the conditions in the OR group, they will be included in the segment.
Build Audience
If you check Build Audience checkbox, you can create an audience directly from that segment with duration and trigger (refer to number 5). When you build an audience from a segment, you are creating a collection of users who match your criteria. This audience may be used later for retargeting campaigns.
- Each exploration can have up to 10 segments.
Add sequence
When it comes to user segments, you have the option to add a sequence to set conditions that occur in a specific order. This is particularly useful when you want to track user actions that follow a particular sequence.
For example, you can use this feature to view the number of users who subscribe to your newsletter after visiting your home page.
Condition Scoping
Condition scoping is useful when you would like to set different scopes within individual condition groups in GA4's segment builder. You can change this by clicking on the icon for each condition category (see number 3 in the picture above).
Recently, available options for condition scoping in GA4 are:
- Across all sessions : It doesn't matter if several conditions occur within the same session or event.
- Within the same session : Multiple conditions can occur within the same session.
- Within the same event : A single event must meet all conditions in the same condition group.
Let's take a look at all the features in an example. In this example, we have a sequence consisting of two steps. It demonstrates users who visit your website for the first time and then sign up for the newsletter within the next five minutes.
Adding time constraints to your sequences is also useful addition that was not available in UA.
Suggested Segments in GA4
To get started with segments quickly, you can use suggested segments before building custom segments. These segments provide a convenient starting point, and all you need to do is modify the conditions according to your specific requirements.
Currently, there are four types of suggested segments:
- General
- Shopping
- Templates
- Predictive
Especially, the Shopping section have several useful options for important metrics in e-commerce. For example, when you select Cart abandoners in prebuilt suggestions, GA4 will include the add_to_cart event and exclude the ecommerce_purchase event. In other words, you will create a segment for users who added items to their cart but did not make a purchase.
Another example, when you select Purchasers under General segments, three conditions will be added to your user segment:
- in_app_purchase
- purchase (recommended event in GA4 for tracking e-commerce purchase)
- ecommerce_purchase
In conclusion, one of the biggest advantages of using GA4 is to create segments in exploration reports. This is particularly valuable as audience-based conversions serve as vital key performance indicators (KPIs), and you can create segments based on your specific questions.