How to Install Google Analytics on WordPress: A Step-Step Tutorial

When a blogger or a webmaster builds a WordPress website, they need to know how the blog is working. And Google Analytics is the only universal method, to see and track the site’s traffic and statistics. However, not all beginners know how to install Google Analytics on a WordPress blog or website.

At the same time, there are lots of outdated tutorials on the web. Some of them talk about the old standard analytics code, and others use long articles without clear steps. So I decided to create this step-by-step tutorial, to help you add your tracking code easily.

The first thing you need is a Google account. You need it to sign up for Google Analytics. It’s a free service provided by the biggest search engine. On the sign-up page, add your website address and check the boxes as you want, then, click the blue button “Get Tracking ID“.

How to Install Google Analytics on WordPress

Now, you get the page with your tracking code. If, for any reason, you can’t see the code, and that happens sometimes, this is  how to find the Google Analytics code:

Click the “Admin” tab at the top of the Google Analytics account, and click the “Tracking info” link as the below screenshot:

Google Analytics admin area

When you click the “Tracking info”, multiple links will be there. You just need to click on “Tracking code” as below:

Google analytics code

Now, you have the tracking code, and you need to insert it on every page of your WordPress website. There are a couple of options, the easiest one is adding the code to your theme, and the others are using a plugin. Let’s talk about them in detail.

Adding Google Analytics tracking code in Genesis themes

Genesis child themes are popular for the clean structure, and thousands of new blogs are built every day with Genesis. If you have a Genesis theme, you can paste the code in the theme’s dashboard, but, first, login to your WordPress admin area, and click “Genesis” then, “Theme Settings” as this screenshot example.

Adding Google analytics in Genesis theme

In the theme dashboard, scroll down and find “Header and Footer Scripts“, and paste the code there.

analytics code in Genesis

Click the “save changes” button at the bottom of the Genesis settings page and clear your cache, if you are using a caching plugin. That’s it for Genesis themes.

In other WordPress themes, you need to browse the control panel and find the option “Analytics” or “tracking codes”, it’s easy to install and set up, as in the above example.

Installing Analytics code with a Plugin

The easiest way to add your tracking code is by installing a plugin called Insert Headers and Footers. Just activate that plugin, and click its link in the left menu, under “settings,” as in the following screenshot.

Install Google Analytics on WordPress with a plugin

Don’t leave the page before clicking the “Save” button. This easy method works with all themes, and it’s safe; I don’t recommend using the classic method, by inserting the code into the “head” section in your theme; it’s only required if you’re not using WordPress.

Editing the theme can risk your blog functions if you’re a newbie. So, use the above plugin, and it’s done.

Please remember that your site analytics will be available in the next 12 to 24 hours in general. The statistics change per 24 hours; however, you can see how many visitors are online on your blog or website, by clicking the “Reporting” tab on your Google Analytics dashboard. Then, “Real Time” and “Overview” as the following examples.

Real time website visitors overview

 Why do you need Google Analytics?

When you create a blog, you can work hard to create helpful tools and articles. You can also receive emails from your readers, but you can’t see how many real humans are visiting your site. Google Analytics is more than a tracking tool. It’s a good way to see how people interact on your site, and, most importantly, from where they are coming from.

If you’re working on a specific location, for example, and found that you receive good traffic from a different region, then, you need to create content for those people. They are visiting your site to find information or to get help, and you can multiply your traffic easily, by optimizing the content for each location.

The Google Analytics dashboard is easy to understand now, all you have to do is spend some minutes, and it’s done, but the same dashboard was very complicated to understand, in the last few months. Even, an engineer couldn’t understand the Google analytics menu easily. However, people learned how to grow and build their businesses with the help of Google. So, browse the links and test them one by one; you will find good tools to use.

The Google Analytics Help Center is the right place to learn how to use geographic statistics and all the other tools. Best of all, you will learn how the analytics tools are working exactly.

The Google Analytics audience can give you clear data about the traffic that your website receives. You can refine the organic traffic coming from search engines, such as Google, Bing, and Yahoo. At the same time, you can see how many visitors are using a specific operating system, or, a web browser.

That can be very useful when you’re developing a theme, and you see that lots of visitors from the not supported browsers are visiting your site. So, you can optimize the website theme to work well in that browser.

You can also, see how many visitors are using desktops, mobile devices, and tablets when coming to your website. The screen resolution can solve many problems when you have. If you see, for example, that you have a good amount of traffic with a specific smartphone, then, adopt your mobile theme to work well with that device.

These are simple tools to use in Google Analytics. Just make sure to understand your audience, and see how your blog or website is doing every day. That will not only help but also, that will target the right content to the right people and location.

Avatar for Fathi Arfaoui
About Fathi Arfaoui

Fathi Arfaoui is a Physicist, Blogger and the founder of Trustiko.com. He shares Business, WordPress and Blogging tips to build a better blog and succeed online.

Disclosure: The recommendations on this page are my own based on my tests and analysis. We may earn a small commission from web hosts and other partners if you use my referral link to make a purchase. That’s what helps us to maintain the site and add fresh content, Thanks for your support.

Leave a Comment