Hey there, Benjamin from Loves Data here. Welcome back! In this video, I'm going to
show you how to link Google Analytics 4 (GA4) to Google Optimize. And how you can check that data
is flowing into your GA4 reports. I'm going to start by showing you how to update your Google
Optimize container if it's already linked to the previous version of Google Analytics, so Universal
Analytics. And then I will show you how to link GA4 to Google Optimize if you're getting started
for the first time. Before we cover these steps there are a few important things to consider.
So let's head to Google's support article about connecting Google Optimize and GA4...
I've included a link to this article in the description below this video. I wanted to show
you this because there are some limitations if you connect Google Optimize and GA4. The main things
I want to highlight are... When you connect Google Optimize to GA4 you can only run 10 experiments at
the same time... The objectives you can choose for your experiments are limited to purchases,
revenue, page views, and conversions... So I recommend taking a moment to review these
limits and hopefully we will see some changes to these limits in the future. And if you've
already connected Google Optimize to Universal Analytics there are three other important things
to consider. First, Google says that when you update your link from Universal Analytics to GA4,
any experiments that are currently running will stop. When I've tested this, they still
appear to be running, but the experiments aren't linked to Google Analytics. Second,
if you're using personalization, then you will probably want to edit these experiences.
If you don't, then they won't be connected to GA4. And finally, you might need to replace
the Google Optimize snipped on your website. Okay, now let's head to Google Optimize...
This is my existing Google Optimize container and it's linked to Universal Analytics.
To link it to GA4 we need to select 'Settings' on the top right corner...
And then click the edit icon for the 'Measurement' card...
We can see it's linked to a Universal Analytics property because the tracking id in the brackets
starts with a 'UA' and then a 'dash'... And traveling down we can see it says 'Views'...
These two things indicate that Google Optimize is linked to a Universal Analytics property.
So we need to update this because we're now using GA4. So we just need to select
the existing property at the top... And find our GA4 property. All of the GA4 properties
you have access to will have a label. When you've found your GA4 property, select it...
And choose the data stream... And then click 'Save'...
We've now linked Google Optimize with GA4, so let's check our experiences... We can see the
experiment and personalization are still running, but these aren't automatically linked to GA4.
Let's start by selecting the personalization experience...
Let's select the 'Details' tab at the top...
Scrolling down... We can see that under 'Measurement' it says that
Google Analytics is not linked. So to fix this up, let's scroll back up...
And click 'Edit'... Now let's select the first option that will archive the current experience
and create a new draft experience using the same settings. Let's click 'Select' at the top...
Scrolling down... We can now see our GA4 property is enabled... So let's scroll
back up... And click 'Start'... And 'Start' again... This personalized experience has
now been relaunched and it will send data to our linked GA4 property. Now let's navigate back...
And let's select the experiment...
Now let's select the 'Details' tab... And scroll down... Under 'Measurement and Objectives' it
says that Google Analytics isn't linked. So to fix this up too. Let's scroll back
up... Click 'Edit'... And choose the first option, like we did with the personalization experience...
Now scrolling down, we can see Google Analytics is linked. Since we switched to GA4, we now need
to set the objectives for the experiment. Let's click 'Add Experiment Objective'...
And choose the objective we want to use for the experiment...
You can select two additional objectives, but I'm going to leave these,
and I'm going to scroll back up... And click 'Start'... And 'Start' again...
The experiment has now been relaunched and it will send data to our linked GA4 property. Now
I want to show you how to check data that is being collected into GA4. I'm going to show you
this using the real time reports, but if you would like me to cover how to report on your experiments
in more detail using GA4, then let me know in the comments below. Let's open my demo site to check
the experiences are running... My demo site has loaded, along with Google Optimize. So now let's
head to Google Analytics to see if details from Google Optimize are being collected...
And let's navigate to 'Reports'...
And then 'Realtime'... We can now see there are two additional events being collected.
There is one called 'Optimize Personalization Impression'... And another called 'Experiment
Impression'... Let's select 'Optimize Personalization Impression'...
We can see there is a parameter called 'Optimize Personalization ID'
which lets us report on the ID from the experience we relaunched in Google Optimize...
And if we travel back... And select 'Experiment Impression'...
We can see there is a parameter called 'Experiment ID' which lets us report on the
ID for the experiment we relaunched in Google Optimize... If you want to be able to report
on these IDs in Google Analytics, then you will need to register these parameters to use in your
reports. I'm guessing at some stage there will be automatically available, but at the moment you
will need to register these yourself to use them. To do this, you need to select 'Configure'...
And then 'Custom Definitions'... Then we need to click 'Create Custom Dimensions'...
And now let's name the dimension 'Experiment ID'... Leave the scope set to 'Event'... And
let's enter a short description. Let's enter 'The experiment ID from Google Optimize'...
And for the event parameter we need to enter 'experiment', 'underscore', 'id',
all in lowercase... Now let's click 'Save'... And we can repeat this for personalization.
Let's click 'Create Custom Dimensions' again... Name the dimension 'Personalization ID'...
Enter a short description...
And enter 'optimize', 'underscore', 'personalization', 'underscore',
'id', all lowercase... And click 'Save'... Moving forward,
you will be able to report on these IDs when you create exploration reports in GA4.
So that's how you can update Google Optimize so that your account is linked to GA4 instead
of Universal Analytics. And how you can check that data is flowing through to your reports.
Now I'm going to show you how to link Google Optimize to GA4 if you're getting started for the
first time. Let's head back to Google Optimize to take a look... If you're getting started, then you
will begin by creating a Google Optimize account. So let's click 'Create Account'... Now we need to
name our account. I recommend using the name of your business or organization. I'm going to name
my account 'Loves Data'... Then you need to choose the data sharing options for your account...
Select your location... And agree to the terms... Then we can click 'Next' at the top...
Now we need to name the container. You can name this anything you like,
but it should describe where you're going to be running experiments and personalization. I'm
going to enter 'Loves Data' as the name of my container... Then we need to click 'Create'...
We've now created our Google Optimize account and container.
To get the Google Optimize tag you need to add to your website and to link Google Analytics,
we need to select 'Settings'... And let's click 'Link Analytics'... You can now select your GA4
property from the drop-down... And choose the data stream. If there is more than one data stream,
then you'll need to ensure you choose the stream that is implemented on the website
where you want to use Google Optimize. When you're happy, you can click 'Link'...
We've now linked our new Google Optimize container to Google Analytics. To learn even more about
Google Optimize, I recommend watching my other Google Optimize tutorials. I've included links
to these in the description below this video. And if you would like me to cover reporting on
your experiments in more detail, please let me know. Have you linked Google Optimize and 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!