How to Set up Google Analytics on a WordPress Website

There are many people who do not take advantage of the amazing program that is Google analytics and one of the reasons is because they just don’t know how to set it up correctly. Well the truth is that it is not difficult if you look past all the HTML codes and just follow a straight guideline that I will show you here.

How to Set up Google Analytics on a WordPress WebsiteThe 3 tools you’ll need to set up a Google Analytics account on your site:

  1. A Google Analytics account.
  2. A WordPress website.
  3. A fre plugin called All in One SEO.

Here is a short summary of how to set up Google Analytics on your WordPress site:

  1. You’ll first get a code from Google Analytics called the UA code (Universal Analytics).
  2. You’ll head over to your WordPress site and access the All in One SEO Plugin.
  3. In the section of All in One SEO where it asks for UA code, you’ll paste the Google Analytics code.
  4. And you’re done!

I’ll be showing you how this is done shortly. For first timers, it may be difficult, but once you get this working, it takes about 1-2 minutes to set up.

What is Google Analytics and what is it used for?

It may sound like a dumb question, but I run into quite a number of people who really don’t know the answer to this. So just in case, here you go:

Google Analytics is a completely free program set up by Google themselves to help websites figure out what is going on with the traffic that comes to their page. 

While there is a plethora of information provided by this program and to be honest, I don’t even understand or use most of it,  what I can say is that I use the most basic functions offered by it and I love it because through seeing the information it provided me, I have been able to make smarter sales funnels, tweak my website and it’s pages to be more appeasing to my visitors and search engines and much more. 

Now as for some of the most basic functions of this program, here’s a small sample of the type of information it gives you:

  • It will show you how many people visit your page hourly/daily. 
  • You’ll see how long people stay on one or several pages. 
  • You can see the bounce rates on your website.
  • You can see demographics of the types of audiences that come to your site. 
  • You can see where they come from, whether from a mobile device, a tablet, or things like specific search engines. 

This program has segments where all of this information (And much more!) is provided to you in an informative report that is often just numbers, sometimes graphs and graphs.

But in any case, having this amazing program installed on your site is going to basically give you vision of what your visitors do when they come to it. And with that information, you will be armed with the type of knowledge to make the necessary changes to help your page grow. And if that’s not what you’re interested in, then at least seeing the traffic numbers is an exhilarating experience!

How does one set up this program on their WordPress website? The 1 minute set up:

1) First of all, install the following plugin to your WordPress page: All in One SEO. You can find it on your website’s plugin’s page.

2) Once it’s installed, activate it and then go to the official analytics website by just Googling it. 

3) Click “Sign in” on the top right, then the word “Analytics”. This will bring you into the main area of the program.

4) From there, if it’s your first ever set up, you will need to click where it says “Create new account”. Should this be your first setting it up, skip to part 7 below.

5) And if you DO have a page up there already and need to add a new one, follow the next steps. Basically it won’t let you set up a new account as easily. It’ll first show you existing website/s and you’ll need to find the area where you can add a new one.

To do that simply click on ANY existing page you already have installed to show it’s stats (even if there are no stats) and find where it says “Admin”. Here is an image of how it looks:

As long as you can find where it says Admin, you’re good to go! 

6) Click on it and once you do, a basic menu of your page will appear:

7) Name the account whatever you want, preferably the name of the site or at least it’s topic. There will also be a fill in for other information such as the URL, the timezone from which the stats will be recorded for the site (pick the timezone you’re located in):

Leave the rest that’s underneath that info (which is checked) as it is. Basically fill in the most essential things and get to where you see this button (which is on the bottom).

Note: Do you have an http or https site?

In the Website URL, be sure to select this carefully. I have a lot of https sites and it is important to list this in Google Analytics when you do it. An https website is considered to be secure and Google likes websites that have this. It’s known as SSL and one it’s one of Google’s ranking factors.

But anyway, once you fill all of this out, again, when you get to the bottom button, Click it. This is what it’ll look like:

8) This will finally bring up the tracking code but not before a pop up window will appear asking you to accept their terms. Accept them.

9) Now you will finally get your tracking code! You’ll want to keep it simple and copy the tracking code you get. It should start with a UA. See the image below for reference:

10) Now head back to your website with your tracking code and log into it. Click on your All in One SEO, the general settings and on the page scroll down to where it shows you this:

Then save your settings by scrolling all the way down the above page. 

That should be it, now it’s time to test if it’s working!

That was a long series of steps, but you know what? It’s easy if you do it at least twice. But let’s see if everything check out…

  1. To make sure it’s OK, have your website opened so you’re on it. 
  2. Open a new window and visit Google analytics again.
  3. Open your page which you just made an account with from the steps above. By now this program will show it.

The only thing is, it’ll be a little bit annoying. You’ll have to click on your site, then an extra window will pop up right to it that will say the website name again, click it, then another one that will say “All website data” will appear right of that, click that and finally that will open up your site information (yeah I wish they didn’t complicate this either):

And each time you log in, this will be the procedure. Worry not, it takes 2 seconds to reach step 3. But once you click it, now you will be in the dashboard where all your information is shown.

In the left hand menu, click “Real Time”, then underneath it, overview. Now look at the window which pops up. If the “Right now” option says “1”, it means it’s recording and that 1 number is YOU visiting your site.

The reason I told you to stay on your site is that most of the time when you test this, you won’t have live visitors, so if you stay on it, Google analytics will record it as a visit and if it shows, that means the tracking code is working and you’ve successfully set this up! This is how it should look (well in my case it’s 2, but in yours it’ll be 1):

My final thoughts:

The key is to ignore all of the fancy codes and menus and to stick to the 10 steps.

Google analytics has so many areas to explore for data, and it’s very easy to get lost there and incorrectly install your code, but if you follow my 10 steps, you’re going to successfully set it up with what is possibly the fastest and easiest method.

Like I said, these 10 steps take me a minute or two to do whenever I make a new site and connect it with that program, but doing this at least once is essential to any webmaster.

Without this program at your disposal, you will never know how it’s performing, how many visitors it’s getting or any of other bare bones information you simply cannot have a functioning website, let alone an online business without. 

Swallow your fear, follow the 10 steps and you’ll see there’s no problem! And if you do run into it, let me know below in the comments section on which part you got lost. 

Do NOT worry if you screw up and don’t successfully install it the first time, you can later delete the messed up account and reinstall a new one with the same exact steps.

But what should I focus on when I have this done? 

I have a tutorial on Google Analytics for beginners which shows what to focus on when you use it. There is so much info and it’s easy to get lost. But for beginners, as long as you focus on the basic things this program provides, you’ll be fine.

This is the most crucial data I focus on, and the rest is optional for me personally. But these 3 things give me enough information to make smart decisions on where to take my page in the future, what to change and monitor how the site is doing overall. I also recommend you get Webmaster tools in addition to this.

Struggling to make your website get more traffic and sales?

If looking over Google Analytics, you noticed that it’s slacking in traffic and needs help, you’ll want training for that. If that is the case, I would highly recommend the Wealthy Affiliate program as it provides that exact training. This is what it helped me accomplish on my website: 


google analytics traffic report

These are the kinds of graphs you’ll want to see on your Google Analytics account and this is exactly what Wealthy Affiliate will help you do.

14 thoughts on “How to Set up Google Analytics on a WordPress Website”

  1. Really great info, Vitaliy. I learned a bunch from you today. I think setting up the accounts are the easy part, but then wading through the mound of information that’s available is another story entirely!

    I’m like you, I want to keep it simple and only look at the simple metrics.

    One question. If I already have an Analytics account on a site but want to change it to https, do I actually change it or do I create a new account? If I create a new account, that gives me a new tracking id, right???

    Thanks for taking the time to share your thoughts,

    • Great question Steve, honestly, the people I took my advice from on the https topic only mentioned adding the https site to webmaster tools, not Google analytics. I never updated my code when I made the switch and my stats are still showing fine apparently.

      I will ask about this and do an update on this page should it become necessary.

  2. I really enjoyed the information here. I set my site up with google analytics as part of my training on Wealthy Affiliate. The process was a lot easier than I expected and your 10 steps here basically lay it out perfectly. I never really knew what to look at on the analytics page but now after reading this I will take your advice and start using it more like you suggested. Hopefully help to create some real traffic to my important pages.

  3. Very nice and easy to understand tutorial.

    I’m relatively new to google analytics myself and am trying to learn more about how to best implement it with my new website.

    I like your tip about uncovering specifically which of your pages your organic traffic is being funneled through. That’s something I hadn’t paid much attention to.

    Thanks again.

  4. Hey Vitality,

    thanks for this step-by-step guide, I really appreciate it! I just added my site to Google Analytics and everything seems to be working (so far) ;).

    Now I’ll have to decipher all those stats and how to leverage them to my advantage.

    I’d love to read your take on how to “tame” Google Analytics – Is there any chance you’ll be publishing a post on that topic in the future?

    Keep up the good work,


    • Hi JT, as I said in my post, I am not an analytics expert yet and I did share the 3 main things I personally look at when I analyze my stats. It’s certainly small in proportion to what this program can give you, but for me, it’s enough to make smart decisions.

  5. Hi Vitaliy

    Great post on how to set up and use google analytics.

    Clear instructions on how to set analytics up and how to use the audience acquisition and behaviour tabs to gain info on the visitors to a website.

    I see you say to install an SEO plugin in wordpress before installing google analytics, so is this because SEO is used by google or is it just a requirement?

    What can webmaster tools provide that google analytics can’t?

    On the whole I think this is a great tutorial on analytics because many web masters out there, including me, who doesn’t have a clue on how to use google analytics.

    Thanks very much. Bye for now.


    • That SEO plugin (All in One SEO) helps Google identify your site faster. It’s like a name tag for your page in it’s initial stages. This plugin is not required to have nor is it necessary to set up an analytics account, but it does make it easier and finding/installing it is also very simple.

      As for webmaster tools, it’s acts as tool to show you how your site is doing on Google, and analytics just shows you how your site is doing with people who visit it, so 2 different things.

  6. Hey Vitaliy,

    Great write up here. I know when I first loaded Google Analytics, I was so lost I didn’t open it again for days!

    Now after I have setup numerous websites with it, it takes no time at all to do.

    The sheer amount of data available however is mostly lost on me still to this day. I stick to getting the most valuable data from it as possible, more often than not this requires further research as well.

    My website seemed to get a lot of referral spam traffic recently. With a quick google search, I learned how to setup filters to exclude this data from showing in Google Analytics, which is useful.

    I would explain how to do this here but I think it needs it’s own post! You can simply google “Referral spam traffic” to find the answers anyway.

    All the best,


  7. Guilty, add me to your list of folks that had no idea about Google Analytics and what it is for… so thanks for breaking it down on your site!

    I managed to add on my website on Google Analytics (within 10 minutes- ok, I’m a bit slow…), my traffic looks pretty dismal at this point as I am still learning how to monetize it. But hope it will improve over time…

    I would say your tips and instructions is perfect for website newbies like myself. Thanks again!

    • No problem Merrell. Don’t stress about the stats on your site especially if it’s new, it’s normal for it to show small numbers. Focus on looking up popular keywords and writing good content on your site and those stats in Google analytics will change drastically for the better!

  8. Thanks for that article.. It is very professinally written and easy to read. It actually helped me as well, even though I’ve already had Google analytics account before and I knew what it was for. I didn’t know however how to use, set it up as it is not super clear when you first start. Just one question – what does organic traffic mean exactly?

    • Organic traffic is simply traffic from search engines, aka natural traffic that comes free to your site. Someone Google’s a keyword phrase and if your site shows up and they click, that’s an organic visit.


Leave a Comment