Hey there, Benjamin from Loves Data here. Welcome back! In this video, I'm going to show you how to
install Google Optimize using Google Tag Manager. And I'm also going to show you how to link Google
Optimize to the latest version of Google Analytics - Google Analytics 4 (or GA4 for short). Okay,
so we're looking at the Optimize page on Google's Marketing Platform site, so we can click the
button to get started... Or we can simply navigate to 'optimize', 'dot', 'google', 'dot', 'com'...
Since I'm already logged in to my Google account, we can see that we're ready to get started.
And let's begin by creating an account... We need to name our account. I recommend using
something similar to the name you've used for your Google Analytics and Google Tag Manager accounts.
I'm going to name my account 'Loves Data'...
You can choose the data sharing options for your Google Optimize account... And then you
will need to select your country... Agree to the terms... And click 'Next' at the top...
Now we need to name our container. You can setup one or more containers in your Google Optimize
account. If you're just looking to run tests on one website, then you will only need to set this
up once. But if your organization has multiple website and you want to run different tests
on each site, then you can create a separate container for each site. This is just like
how containers work in Google Tag Manager. Okay, so I'm going to enter 'Loves Data' as
the name of my container, but you can name this anything you like... Now let's click 'Create'...
Our new account and container has now been created. Now let's click 'Settings'... At the top,
we can see the ID for our Google Optimize container... We will need this in a moment when
we head to Google Tag Manager, so let's copy the container ID... Now we can see the option to link
Google Optimize to Google Analytics... So let's click 'Link to Analytics'... You will see a list
of the Google Analytics properties that you have access to based on the Google account you've used
for Google Optimize. You can see Google Analytics 4 properties are highlighted with a 'GA4' label...
And Universal Analytics properties, so the previous version of Google Analytics,
include the property ID which starts with a 'UA' and a 'dash'... So you can connect Google Optimize
to GA4 or Universal Analytics. I just want to highlight, that you can only link to one property,
so I recommend selecting the one you use most often for reporting and analysis. I'm going
to select my GA4 demo property from the list... Then we need to select a data stream. This should
be the data stream that you're using on your website to send data to your GA4 property. For
my GA4 property, we can see there's only one data stream, but if you have multiple data streams,
take a moment to ensure you select the correct one. And if you're new to Google Analytics 4,
then check out my other tutorials. I've included links in the description below this video.
I also want to highlight, that when you use a GA4 property with Google Optimize,
there are some different limits. Let's head to Google's support article to take a quick look...
Scrolling down... We can see that there will be different limits in Google Optimize when we
connect to Google Analytics 4. Currently, if you want to target people coming from your Google Ads
campaigns, this option is only available at the moment with Universal Analytics... We can run
10 experiments at the same time with GA4, while it's 24 if we're using Universal Analytics...
We can choose from purchases, revenue, pageviews and conversions for our experiment objective with
GA4. While Universal Analytics includes some additional options, like session duration,
bounces and AdSense metrics... There are also some other differences... I've included a link in the
description below this video so you can check them out. Okay, let's head back to Google Optimize...
We've already selected our Google Analytics property and stream, so let's click 'Link'...
We can now see we've successfully linked Google Optimize and Google Analytics.
And I want to mention, that if you're not going to use Google Tag Manager to implement Google
Optimize on your website, then you can add the snippet to your website to get up and running...
And to create experiments (and experiences) in Google Optimize,
you will need to be using Chrome as your browser, and you will need to install the Google Optimize
extension. It's straightforward, so I'll let you complete those steps yourself.
And you can see I've already installed the extension... Okay, so we've already copied
the container ID from Google Optimize, so now let's head to Google Tag Manager...
Now we need to create a new tag... Let's name the tag 'Google Optimize'...
And let's select 'Tag Configuration'... And choose 'Google Optimize' as the tag type...
Now we need to paste the container ID we copied from Google Optimize...
Next we need to add a trigger, so let's select 'Triggering'... And let's select 'All Pages'...
This will mean Google Optimize is added to all of the pages on our website.
And let's save the tag...
Now let's click 'Preview'...
Check that our website's URL is entered correctly... And click 'Connect'...
We can see tag assistant has loaded... And we can select the 'Tag Assistant' tab...
This shows us that the Google Optimize tag has successfully fired on our website.
Now let's head back to Google Tag Manager...
And let's click 'Submit' to publish the Google Optimize tag to our website...
Since we're using Google Tag Manager to implement Google Optimize,
you might also want to add Google's anti-flicker snippet to your website. This is an extra piece
of code, that ensures that the page isn't loaded before the experiment. If the pages loads first,
then you might see the original content before your variant is loaded. And this can cause a
flicker. Adding the anti-flicker snipped prevents this from happening, but it can't
be installed using Google Tag Manager. Let's take a look at Google's support article...
I recommend you read through the details... Then scrolling down... You will find the anti-flicker
script... You will need to modify this to include the container ID from Google Tag
Manager. And if you've implemented a data layer on your website, then make sure the anti-flicker
script is added after your data layer. Let's copy the script... And let's head to my website...
We can see this is where I've added the Google Tag Manager container to my website... Now we
paste the anti-flicker script above the Google Tag Manager container... And replace the 'container
ID' placeholder in the anti-flicker script with the container ID from Google Tag Manager.
Now we can save the changes...
Now that we've added the anti-flicker script and we've published the Google Optimize tag in Google
Tag Manager, we can begin creating experiments and personalizing the content on our website.
Let's head to Google Optimize to take a look... Let's close the container settings...
And let's create our first experience in Google Optimize...
Today, I'm going to show you how to create a simple A/B test on your website,
but I've included extra links in the description below this video if you would like to learn
more about Google Optimize. Okay, let's name the experience 'My First Test'...
And let's enter the page we want to use for our test...
Now let's ensure 'A/B test' is selected... And click 'Create'...
Now we need to click 'Add Variant'...
We need to naem the variant. This should briefly describe what changes you're
making for your test. I'm going to name mine 'New Heading'... And let's click 'Done'...
Now we need to click 'Edit'...
The editor loads...
And we can now make the changes we want to test. I'm going to select the heading... And click 'Edit
Element'... And then 'Edit Text'... And change the heading so that it says 'Featured Products'...
And the color of the font... Once you're happy with your changes, you should take time to preview
them, to ensure they don't impact anything on your website. And when you're happy, click 'Save'...
And then 'Done'...
The next thing we need to do is define the objective for our experiment,
so let's look for 'Objectives'... And then click 'Add Experiment Objective'... You can then choose
the objective. For this experiment, I'm going to select a conversion as my primary objective...
You can also set two additional objectives for your experiment,
but I'm going to leave these. When you're ready to launch your experiment, click 'Start'... We've now
linked GA4 to Google Optimize, implemented Google Optimize using Google Tag Manager,
and launched our first experiment. What are you going to experiment with on your website?
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!