Table of Contents
- Obtaining your Google Analytics code
- Adding the Analytics code to your WordPress website
- Let’s see if it works!
- Still having problems?
Installing Google Analytics to your website allows you to track traffic to your website. You’ll be able to see how many visitors your site gets, and where they come from.
This might seem like a long article, but the process is actually really simple, and will only take a few minutes.
Obtaining your Google Analytics code
To add Google Analytics to your website, you’ll need to install your Google Analytics code to your website. First, you’ll need to obtain the analytics code for your website. There are three possible scenarios for this:
- You don’t have a Google Analytics account at all; see ‘new analytics account‘
- You have an Analytics account, and want to add another website to it; see ‘Existing analytics account, new website‘.
- You have a Google Analytics account, and have added the website to it as a property, but still need to install the code to your WordPress website; see ‘Existing Analytics account, existing Analytics property‘
New Analytics account
Go to www.google.com/analytics, and click ‘Create an account’. Note that having an existing Google Account doesn’t mean you have an Analytics account by default, but you do need an existing Google account to sign up for Google Analytics.
You’ll now see another that sums up the steps of getting started with Google Analytics. Just click the ‘Sign up’ once again.
You’ll now have to sign in with an existing Google account. Enter your account name and password and click ‘Sign in’.
You’ll be taken to a page where you have to fill out details about your new Google Analytics account.
Setting up your account
Account name: Use something that describes the potential group of websites that you’ll put in this ‘Account’. Note that you can have multiple ‘Accounts’ in your Google Analytics account. Confusing right? Example; you can have an ‘Account’ for your own websites, in the case of our example ‘Joe’s Websites’. Let’s say Joe is a web developer who also builds websites for clients. He can now add another ‘Account’ for his clients; ‘Client websites’.
Setting up your property
- Website name: Simply use the name of your website. As long as this will tell you which website this is, it’s good. You don’t have to add “http://www” or “.com / .net / etc”.
- Website URL: Type out the web address, including the TLD (.com/.net, etc).
- Industry Category: Use the drop-down menu to select the industry category that best describes your website.
- Reporting time zone: Choose the time zone that you want to be used for your website. This time zone determines the 24 hour period that will be used to report your websites statistics.
Data sharing options
Choose whether you want to share your analytics data, and with who. A detailed explanation is given. Uncheck the box, or boxes, to not share data.
Get your tracking ID
When you’ve filled out your account details and data sharing options, click the blue button that says ‘Get Tracking ID’.
You’ll now be taken to a page where you’ll be given your Analytics tracking ID. Scroll down, and copy the tracking code.
Existing Analytics account, new website
With an excisting Analytics account, sign in, and click ‘Admin’ in the menu bar.
This will take you to the admin page. Here, click the on the drop down menu below ‘property’, and click ‘Create new property’. The property in this case is your WordPress website.
This will bring you to the ‘New Property’ page, where you’ll have to enter the same details and follow the same steps as mentioned in this article under ‘Setting up your property’.
Existing Analytics account, existing website property
If you have already added your website to an Analytics ‘Account’, go to the Admin page, and click ‘Tracking Info’.
On the next page, scroll down to find your tracking code. Copy this code.
Adding the Analytics code to your WordPress website
The page containing your tracking code states ‘Add the Analytics code to every page you want to track’. WordPress makes this easy, as there are certain elements of your website that are loaded on every page or post, for instance the header and the footer of your website. In this example, we’re going to add the analytics code to the footer of the demo website.
Copy the Analytics code, and go to the dashboard of your WordPress website. Here, click ‘Appearance’, then ‘Editor’.
Here, click ‘Footer’ to open the footer.php file. Paste your Google Analytics tracking code directly in front of the body html tag: </body>. Finally, click the ‘Update File’ button.
Done! You now have your Google Analytics tracking code installed.
Let’s see if it works!
You can immediately check if your Analytics code is installed correctly, by using a free tool on seositecheckup.com.
Go to seositecheckup.com, and add your website url to the box that says ‘Input Website URL’. Then select ‘Google Analytics Test’ from the dropdown menu, and click the green ‘Checkup!’-button.
If your Google Analytics code has been installed correctly, this tool will give you a score of 100/100:
Still having problems?
Somehow didn’t get this to work? Post a comment describing your problem and I’ll try to help you out.