This video is sponsored by Skillshare.
Click the link in my description to receive two free months.
I have two questions for you.
One, do you have a website?
And two, do you have Google analytics?
If not, you're entirely missing out.
Hey guys, I'm Alex Tooby from alextooby.com and welcome back to my YouTube channel.
In today's video, I'm going to teach you how to connect Google analytics to your WordPress
website so that you can accurately track your traffic.
So whether you have a hobby blog, a portfolio site, or you're running an eCommerce store,
having Google analytics is going to be vital to the growth of your website.
When properly installed, you're going to be able to see exactly where your traffic is
coming from, how old they are, what device they're using, and even what page they were
on when they decided to leave your website.
So whether you want more page views, email opt-ins, or purchases of your product and
service, knowing exactly who your audience is and how they behave is going to really
help you optimize your website.
So let's get started.
So the first thing that we need to do is sign up for a Google analytics.
But before we do that, I just want to take a second to mention our sponsor for today,
which is Skillshare.
So Skillshare is an online learning community that has over 25,000 different classes covering
all kinds of creative and entrepreneurial niches.
So for example, design, illustration, business technology, photo and film, and web development.
So if you're interested in tech tutorials like this, then you'll love Skillshare because
they have, again, thousands and thousands of really high quality classes that teach
you exactly what you need to know.
A few of the classes I've enjoyed lately are understanding web development by Christopher
Dodd and CSS essentials by Rachel Andrew.
So if you're interested in learning more about Skillshare, then go ahead and click the link
in my description box below and you'll get two free months of premium subscription.
So the first thing we need to do is create a Google analytics account.
So to do that, you're going to go to analytics.google.com.
You will need a Gmail account, so if you have one, you're going to log in here or you're
going to have to create one.
Once you've logged in, you're going to see something like this.
So then you're going to go and hit the sign up button and you're going to create your
account.
So I would just name this whatever your business is, or you could simply use your name.
Once you have Google analytics set up, you can have multiple domains in that same account,
so you may just want to keep that in mind.
So I'm just going to call it Alex Tooby demo.
Totally up to you if you keep this stuff checked or not.
I'm just going to leave it for now and hit next.
We're going to measure our websites, we're going to keep that checked, hit next, and
then you're going to put in the property details for a specific domain.
So you'll go ahead and type in your domain, and you can actually choose whether or not
you have an HTTP or an HTTPS domain.
If you don't know, don't worry about it, just hit HTTP.
Then you're going to go ahead and select your category and your time zone.
Then you're going to have to accept the terms of service and hit the accept button.
So then you'll end up on this page where you'll see your actual Google analytics script.
So we're going to need this to install on your website in just a minute.
But before we do, I just want to show you quickly what the Google analytics back end
actually looks like so you can know what to expect.
So here is my Google analytics for alextooby.com.
So there are a lot of different options and things to click through on the left hand sidebar.
So I'm just going to show you a few things really quickly.
Right now we're on the realtime tab, and what this shows is the actual amount of people
that are on my website right now.
So I can see that there's 12 people on my website, 83% of them are on mobile and 17%
are on desktop.
I can see the exact URLs that they're on right now and even where they are in the world.
Finally, I can also see where they came from.
So right now, one person is visiting my website directly from YouTube, seven other people
are visiting my website from a undisclosed keyword.
So the next thing we can look at is the audience tab.
And this is where you're going to see what your daily totals are.
So for me, I can see that the last few days I've been hovering just under 4,000 views.
You can see which country they came from.
So if I click this country tab, I can see that majority are from United States.
I'm getting a big surge from India lately, United Kingdom, and Canada.
So that's obviously really important.
And then finally we can go ahead and check out the acquisition tab, and this is going
to show you where people are coming from.
So primarily my website traffic comes from organic search.
Next we have direct, which is generally a link from say an email or if someone typed
my URL directly into their browser bar.
Then we've got social.
So if I take a peek into social, you can see the breakdown of where everybody's coming
from.
So within the last seven days, I've had 332 views directly from Pinterest, 210 from YouTube,
and 107 from Instagram.
So that's what you can look forward to once you have Google analytics set up.
Again, there are a ton of different data points that are in Google analytics, so I just wanted
to show you some of those main things that you can keep an eye on once you have your
Google analytics set up.
So let's finish what we started.
So now we're going to go to the back end of your WordPress website.
So generally you get there by going to your domain name, backslash WPadmin, and you're
going to log in.
Then from here we have a couple of different ways that we can install the Google analytics
script.
So the easiest way is to use a plugin.
So what you're going to do is find the plugins tab on your left hand dashboard and hover
over it, then choose add new.
Then what you're going to do is go to the search bar over here and type in Google analytics.
If you're new to WordPress, plugins are your friend.
There's a plugin for absolutely everything.
So if you want to customize your site in any way, there's definitely a plugin for it.
So you can just go ahead and search for it here and you'll be able to find it.
So as you can see, there are a ton of different plugins just for Google analytics.
So the one we're going to use today is this one.
However, there are many others that could work for you.
One tip I can give you is that if there's a lot of plugins to choose from, I like to
look at the reviews and how many active installations a plugin has.
So for example, this one over here only has 20,000 compared to this 1 million.
So oftentimes you're going to trust the one with the most active installations.
So this one's actually outranking the one that we're going to use today, but it's more
than just Google analytics so I don't think that it's necessary.
So we're going to go ahead and click the install now button.
And once it's installed, the blue activate button will show up so just go ahead and click
that.
From here you're now going to see a Google analytics tab on your left hand dashboard.
So go ahead and click that.
You're going to authorize the plugin and you're going to have to click this one time access
code button.
Then you're going to copy this code and paste it into this section here.
Then press save access code.
So once you enter the code that they gave you, it actually connects your Gmail account
with your Google analytics and it pulls all the appropriate data it needs right here.
So basically at this point our Google analytics is set up.
So that's why I really liked this plugin because it's super simple.
It's really quick to set up, and yeah, it's easy.
So the other option you could do to install your Google analytics is to check if your
theme allows you to add Google analytics.
So for example, I use thrive themes.
If I go into my Thrive dashboard, there's actually an analytics and scripts section.
So I just go ahead and I go manage my scripts and you'll create a new one.
I already have one here for Google analytics.
And this is where you're going to paste that script that we got earlier.
So we'll go back to this analytics page.
I can grab my script, copy it in full, and then just paste it here.
You want to place it in the before backslash head.
Okay, so this means that the script will be placed in the header of your website and it's
going to display on every single page, which means no matter what page someone's on, they're
going to be tracked in Google analytics.
So again, not every theme is going to have this option, but you should definitely check
if yours does because it saves you having to download a plugin and it just makes it
super easy.
So the third way that you can add Google analytics to your WordPress website is by going to the
appearance tab and hitting the theme editor.
This is going to allow you to edit the scripts and files of your theme, which can be dangerous
if you don't know what you're doing.
So if you are going to do it this way, then just follow the steps that I've outlined here.
If it feels too overwhelming because the code looks scary than just stick with the plugin
or the theme option instead.
So what you're going to do is go to the theme header PHP file on your right hand side here,
and then you're going to see a bunch of scary code.
And what you need to do is scroll down until you find that closed tag.
So what we want to do is paste our Google analytics script right before that.
So I'll go back to Google analytics, grab that code, go into my header PHP file, and
then just paste it in.
Then I'm simply going to hit update file and that's going to install the Google analytics
on your website.
So now what you want to do is you want to go to Google analytics, then you're going
to want to go to the realtime report, open up a page on your website, and then just verify
that it's actually showing up here, that there is a person on my website on this specific
page.
So as long as you're showing up here, then everything's installed properly!
So that's how you install Google analytics on your WordPress website.
I hope you guys learned something new today.
I hope this was helpful, and if it was, please hit the like button below and also subscribe
to my channel if you'd like to see more videos like this in the future.
So thanks again for watching and I'll see you next time.