Author Kyle
Rank 1
Google Analytics is the most powerful website analytics tool out there (and it is free). In this video I will walk you through the entire set-up process, from the initial account set-up.

To set up Google Analytics, you simply need a Google Account. You can either use an existing gmail or Google + account and connect your analytics to that (easiest) or you can create a brand new Google account within the set-up.

Here is the link to Google Analytics:

Once you have the account set-up, you will be adding the provided "code" to your websites header.php file which is found under Appearance => Editor inside of your WP-Admin area.

If you have any questions about the set-up process, please leave a comment below and I will be more than happy to help you out.
Join the Discussion
Write something…
Recent messages
Foobard Premium Plus
Ok, so after reading the comments and doing some research, I know that you can just add your Google Analytics code to the SEO All-in-one plugin, and you won't have to redo it the next time you update your theme. It also has the added benefit of not hosing your website if you aren't careful.
I do know that there are some GA plugins that integrate Analytics into your WordPress dashboard, but I'm not really into that.

But my research did not answer a question I have: is there a performance benefit to adding it directly to the header.php file? or for that matter, the functions.php file?
unclesam747 Premium
I can't imagine there being any performance change. It's not like you added another plugin, and if there was any change, it would likely be so minimal that it's not worth worrying about
Foobard Premium Plus
Thanks! Yeah, that makes sense, since we have that SEO plugin installed anyway. They keep telling us that we should minimize the number of plugins running. I deactivate ones that I don't need all the time. Then I activate them temporarily when I need them. Less running plugins is also probably better for security.
The one downside I see to this is if Google changes their code, then the plugin you use will have to update their own. Never use a Google Analytics plugin that hasn't been updated in a long time.
PrimePlace Premium
Kyle I need Help!
I followed the above video and pasted the code accordingly but it is not updated under real time - overview to show anything as it is still at zero????

(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

ga('create', 'UA-97510386-1', 'auto');
ga('send', 'pageview');

<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>

Labman Premium Plus
Why do you need to enter it manually, just add the UA code to the All In One SEO pack and you are done.
amgolf Premium
I add code to Yoast SEO, in the plugin space.
varleysheen Premium
I cant find where you add in yoast
PrimePlace Premium
Thank You It worked!
JackieSmith Premium
Hi Kyle,
Where in the header.php file do we add this code? Is it the verification code that is displayed after we have uploaded the html file to the server? I'm not sure if this is related but I added my website to the Webmaster tool about a week ago. I have since updated the theme but when I go into the Webmaster tool, it's still showing the old theme, so I readded the's still showing the old theme. When I go to Google Analytics, even though I am on my website, it doesn't show that there is an active user. Can you please help/advise.

I'm using Yoast NOT the ALL in One SEO. The site in question is hosted here.
Another site of mine that is hosted elsewhere and is using Yoast seems to be working fine in that it shows the Active user count correctly.
Chezbrown Premium
Hi Jackie, if you haven't managed to get this sorted out yet, go to Marion Black and she has an excellent training for this. I found it easier than Kyle's to follow. xx
MsMerry Premium
Did you also refresh your site after the changes? I use Yoast as well and had no issues. It is probably something simple and you will laugh about it later. :)
JackieSmith Premium
Thanks Chezbrown. Yes. I was following Marion Blacks training which are brilliant. I will review them again.
JackieSmith Premium
Thanks MsMerry. I do not have a problem with Yoast on my non- WA hosted site. The problem is with the site hosted here. Even when I remove the site from Webmaster Tools and add it again, it still shows the template I used when I first registered the site so I'm thinking it's something on the WA end. I will try again, maybe third time lucky.
KachinaB Premium
I actually had to add my tracking number in my All in One SEO. I did not see the "header" tab in my editor section of my website. I didn't want to break my website so I tried another method. This one works just as well. I wanted to share that to everyone who may have seen something different. Check out the link below for more info
Gerlinde Premium
You are right! I prefer this option as well! Otherwise with every theme update you have to do it again...
Thanks for the link!
WAwannab Premium
It seems okay, however, I don't see a #1 even after going on my site. I did have analytics before getting to this lesson and with the help from Jays training, I am now better able to see and understand the traffic. According to what I am seeing on Analytics, it seems to be working correctly, though.
Thanks Kyle!