Hey there, Benjamin from Loves Data here! Welcome back! In this video,
you're going to learn how to add Google Analytics to WordPress. And we're going to be using the
latest version of Google Analytics which is called Google Analytics 4 or GA4 for short.
There are two steps to add Google Analytics to WordPress. First, you will need to create
a Google Analytics property. And then you need to add the Google Analytics tracking code to
all of the pages of your WordPress site. You can complete these steps separately, or, if you want
to get started as quickly as possible, you can complete both steps without leaving WordPress.
Let's head to WordPress to take a look... To get up and running quickly, I recommend using Google's
Site Kit plugin. This is Google's official plugin for WordPress. To install the plugin,
let's select 'Plugins'... And then 'Add New'... Let's search for 'Site Kit'...
And let's click 'Install Now' fo the 'Site Kit by Google' plugin... Now let's click 'Activate'...
Before we configure the plugin, I want to mention that there are different ways you can add Google
Analytics to your WordPress site. You can use a plugin (like we're going to cover), you can add
the tracking code to your template file, or you can use Google Tag Manager. The quickest way to
get up and running is by using Google's Site Kit plugin. It doesn't provide many features,
but it's maintained by Google, it's free, it's pretty easy to use, and it embeds some
key metrics from your reports directly inside WordPress. Okay, now let's click 'Start Setup'...
We can see there are a few steps to complete, so let's click 'Sign in with Google'...
And we need to sign in with our Google account.
If you've already created a Google Analytics account and property that you would like to
install on WordPress, then make sure you login using the account you use for Google Analytics.
This could be your Gmail address, your Google Workspace address, or the login
you use to access other services from Google. And if you haven't created a Google Analytics account
and property yet, then just make sure you login using the account you would like to use to access
Google Analytics in the future. Let's sign in... Enable all of the access options... And let's
click 'Continue'... Let's click 'Proceed' to verify we own the WordPress site...
And let's click 'Add Site'... Now we can click 'Go to my Dashboard'...
We can see that the Site Kit plugin has automatically connected WordPress to
Google Search Console, but we also want to install Google Analytics,
so let's select 'Connect Service' under 'Google Analytics'...
We need to sign into our Google account again... And click 'Continue'...
If you already have a Google Analytics account and property you would like to install on WordPress,
then you can select the account from the drop-down...
And then the property...
If you are connecting an existing property, then you need to select a Universal Analytics property,
which is the older version of Google Analytics and a GA4 property. For example, if we select
a GA4 property... Then we need to choose a corresponding Universal Analytics property...
Or if we select a Universal Analytics property...
Then we need to choose a corresponding GA4 property...
If we select a different Google Analytics account...
And this account only has a GA4 property... Then Site Kit will create a Universal
Analytics property for us. So if you have an existing account and property you want to use,
then just follow the prompts and then click 'Configure Analytics'. But if you want to
get up and running for the first time, then you won't have an existing Google Analytics account or
property. In this case, select the drop-down under 'Account'... And choose 'Set up a new account'
at the bottom... Then we need to name our Google Analytics account. An account in Google Analytics
is like a folder. You can use it to setup Google Analytics for your business or organization. Then,
if you need to set up Google Analytics for someone else, you can simply create another
account. You can name your account anything you like, I'm going to name mine 'Loves Data'...
Next, we need to name our property. A property is used to collect data from your WordPress website.
I suggest using the same name that you use for your website,
so I'm going to name mine 'Loves Data'... And on the right we need to name our view. Each
view is a collection of reports and views are only available in Universal Analytics,
so the older version of Google Analytics. Since we're focused on GA4, I'm just going to
leave the default name. Now you need to choose your country and timezone for your reports...
We can see a message telling us that we will be creating both types of properties in our
new Google Analytics account. So that's good. Now let's click 'Create Account'...
We need to choose our Google account again... Authorize access... And click 'Continue'...
You need to agree to Google's terms of service... Next, you can choose the data sharing options for
your account. In most cases, I recommend enabling all of the data sharing options.
And let's click 'I Accept'... Now let's click 'Go to my Dashboard'...
We can now see that Google Analytics has been connected. This means we've created a new Google
Analytics account and property, and installed it on our website without leaving WordPress.
You will now be able to select 'Analytics' under 'Site Kit' and once you've started collecting data
you'll see an overview of key metrics right within WordPress. Since we only just set everything up,
we can see there is a message saying Google Analytics is gathering data. So if you check back
tomorrow, you will see some quick insights here. In the meantime, let's head to Google Analytics...
To do this, let's open a new tab and enter 'analytics', 'dot', 'google', 'dot', 'com'...
Since I'm still logged into the Google account I used to configure Site Kit, we can see Google
Analytics automatically loads. We're currently looking at the GA4 property for my WordPress site.
You can tell it's GA4 because there are four icons on the very left of the interface.
If we select the current property at the top...
We can then see the Google Analytics account we created... And there are two properties inside
the account. The second property is our Universal Analytics property that Site Kit automatically
created for us. You can select this... And then the reporting view to open Universal Analytics...
Let's head back to the GA4 property...
And let's select 'Realtime'... This report lets you see if anybody is on your website
right now. We can see lots of zeros for my WordPress site, so let's open a new tab...
And I'm going to enter the URL of my WordPress site...
We can navigate to the blog post... And now let's head back to Google Analytics...
We can now see that data is being collected into the reports. You'll need to wait at least
a day or so before you can begin using the other reports in Google Analytics.
So I recommend checking back tomorrow and start exploring all of your reports. So
that's how you can quickly get up and running with Google Analytics 4 on your WordPress
site. To learn even more about the reports and other configuration options available in GA4,
please take a movement to check out my other videos and resources. I've included links in
the description below this video. Have you installed GA4 on your WordPress site? I'd
love to know! Let me know in the comments below. And if you found this video helpful, then please
like it so I know to make more videos like this one. See you in the next video!