Hey there, Benjamin from Loves Data here. Welcome back!
In this video, we're going to look at segments in Google Analytics 4 (GA4). Segments allow you
to focus your report on particular sections of your traffic. For example, you might want to
focus on people from particular geographic locations, or people who found your website
in organic search results who also converted. Or maybe you want to see people who made a purchase
after watching a video embedded on your website. Segments allow you to achieve this in GA4.
You can create and apply segments when you're using the exploration reports in Google Analytics
4. So this means you will need to create an exploration report and a segment. This
is different to the previous version of Google Analytics (Universal Analytics) where segments
could be saved applied across default and custom reports. Let's head to GA4 to take a look...
I've already opened Google's GA4 demo property and we're looking at the 'Home'
report. As I just mentioned, segments are only available when you create explore reports,
so you will need to navigate to 'Explore' in the main menu on the left... This means if you're
looking at 'Home', 'Reports', 'Advertising', or 'Configure', then you won't be able to apply
segments. Now let's select 'Explore'... We can now create an exploration report in Google Analytics,
or we can view and edit an existing report. Across the top, you can also see the different types of
exploration reports you can create in GA4. We can create free-form reports, funnel and path reports,
segment overlap reports and more... You can apply segments to any of these exploration
reports. I like to start from scratch, so I'm going to travel back... And click 'Blank'...
This will create a blank free form report by default... Let's name the report 'US
and Non-US Users'... Okay, on the left we can see there is an option to add segments,
dimensions, and metrics to use in our report. Let's click the plus sign next to segments...
At the top we can see types of custom segments we can create...
These are user segments, session segments, and event segments... Below this, we can see
segments that are automatically suggested for us... For Google's GA4 demo property,
we can see suggestions include recently active users, users who haven't purchased,
and users who have purchased... And if we select the 'Templates' tab... We can then see segments
for demographics, technology, and acquisition... And finally, we can select the 'Predictive' tab...
These predictive segments become available if you meet Google's minimum requirements,
this is because predictive audiences rely on a minimum amount of data to ensure they're accurate.
For Google's GA4 property we can see a number of predictive segments based on purchase events...
Today we're going to focus on custom segments, so I want to begin by explaining the difference
between user, session and event-based segments. Overall, the different types of segments let you
control how much detail is included (or excluded) from your report. Here we can see the relationship
between events, sessions, and users. When someone comes to your website and loads a page, and
performs other actions, like clicking an outbound link, watching a video or making a purchase. Then
all of these actions are sent to Google Analytics as events. Events are then combined into sessions.
A session is a single visit to your website. So if someone comes to your website on Tuesday morning
and navigates through a number of pages, then all of these events will be combined
into a session. Sessions are then associated with each user that visits your website.
For example, if someone visits your website on Tuesday and then comes back on Thursday,
then you will have one user along with two sessions. So the different types of segments,
lets you decide if you want to match individual events, sessions, or users. For example,
let's say you want to create a segment for people who viewed the contact page on your website.
You can choose to define an event-based segment that only includes the contact page. Or you can
define a session-based segment that will include all of the details for the session that included
the person viewing the contact page. Or you can define a user-based segment that will include all
of the details for the user if they've viewed the contact page during any of their sessions.
So the type of segment you choose really comes down to what you want to see in your report. Okay,
let's head back to Google Analytics... We're going to create a segment for people located
in the US. So let's select 'User Segment'... And let's name the segment 'US Users'...
Now let's click 'Add New Condition'... And search for and select 'Country ID'...
Now we click 'Add Filter'... And change 'Contains' to 'Exactly Matches'...
And enter 'US' as the value... And click 'Apply'... We can now see a summary for
the segment on the right... We can see the number of users included in the segment...
Along with the number of sessions for these users... Now let's click 'Save'...
And let's create a segment for everybody located outside of the United States.
Let's click the plus sign next to 'Segments' again... Let's choose 'User Segment'... Let's
name the segment 'Non-US Users'... And let's click 'Add New Condition'... Let's search for and select
'Country ID'... And let's click 'Add Filter'... Now let's change 'Contains' to 'Does Not Exactly
Match'... And enter 'US' as the value... And click 'Apply'... This segment will
now include users from all countries outside the United States. Now let's click 'Save'...
We can now see both of our segments have been applied to our report,
so the next step is to add dimensions and metrics. Let's click the plus sign next to 'Dimensions'...
And let's search for and select 'Item Name'...
And click 'Import'... Now let's click the plus sign next to 'Metrics'...
And let's search for and select 'Ecommerce Purchases'...
And let's also search for and select 'Ecommerce Revenue'... Now let's click 'Import'...
We can now see the dimension and metrics on the left... And we can drag the dimension
under 'Rows'... And we can drag the metrics under 'Values'...
We can now see the items people are purchasing based on the number of purchases and revenue...
And we can also see this split by the segments we created and applied to the report...
Okay, now we're going to create another report that includes two segments based on how people
are finding our website. We're going to create one segment for our organic traffic
and another for our paid traffic... Let's head back to Google Analytics... Let's navigate back...
And let's click 'Blank' again... Let's name the report 'Organic and Paid Pages'... This time,
let's start by adding dimensions and metrics to our report before we create our segments.
Let's click the plus sign next to 'Dimensions'... And let's search for and select 'Page Title'...
Now let's click 'Import'...
And let's click the plus sign next to 'Metrics'... And let's search for and enable 'Views'...
And 'Sessions'... And 'Conversions'...
Now let's click 'Import'... And let's add the dimension
under 'Rows'... And the metrics under 'Values'...
Now let's create our segments. Let's click the plus sign next to
'Segments'... Let's choose 'Session Segment'... And let's name the segment 'Organic Traffic'...
Now let's click 'Add New Condition'... And let's scroll down... And select 'Traffic Source'...
This shows us the dimensions we can use to create our segment. You will notice that
there are only a handful of options for our traffic sources. And there's currently only
one option for session-based dimensions, which is the 'Session Default Channel Grouping'... Not
all of the dimensions we can find in reports are automatically available to use with our segments.
However, since the traffic source, medium, and campaign are automatically collected as parameters
with our page view events, we can still create segments based on the value of these parameters.
If you would like to learn more about events, parameters, and custom definitions, I recommend
checking out my GA4 courses and my other tutorials on YouTube. I've included links in the description
below this video. Okay, so to use parameters that are automatically collected as parameters, let's
scroll back to the top... And select 'Events'... Now let's scroll down... And select 'Page View'...
And let's click 'Add Parameter'... Now let's search for and select 'Medium'... Let's select
'Exactly Matches'... And let's enter 'organic' as the value... Now let's save our segment...
We can now see our organic traffic in the report...
And let's create a segment for our paid traffic. Let's click the plus sign next to
segments again... Select 'Session Segment'... Name the segment 'Paid
Traffic'... And click 'Add New Condition'... Now we select 'Events'... Then 'Page View'...
Let's click 'Add Parameter'... And search for and select 'Page Location'... Let's leave 'Contains',
and enter 'gclid' as the value... This will match any pages people land on with
the parameter from Google Ads. Let's click 'Apply'... And now let's click
'Or'... Let's click 'Add New Condition' again... Then 'Events'... Let's select 'Page View' again...
Click 'Add Parameter'... Then search for and select 'Medium'... Now we can select 'Matches
Regular Expression'... And enter 'CPC', 'pipe', 'Paid'... Click 'Apply'... And save the segment...
This segment will then include any sessions that are from Google Ads,
or that include 'CPC' or 'Paid' as their medium. So that's how you can segment your reports in
Google Analytics 4 (GA4). Remember, that you can only apply segments to the exploration reports.
And the great thing about segments is that you can apply up to four segments at once to your
reports to compare how they perform. I also recommend checking out the 'Segment Overlap'
report that lets you see if users are matched to multiple segments. Are you using segments in GA4?
I'd love to know! Let me know in the comments below. And if you found this video helpful,
please like it, so I know to make more videos like this one. I'll see you in the next video!