How to Setup Google Analytics on a WordPress Website
- 6 min read
- Karla Sambolić
Google Analytics is a free web analytics service that tracks and reports website traffic.
You can use Google Analytics (GA) to answer questions like.
- How many visitors come to your website?
- How long do they stay?
- What pages do they visit?
- Where do your visitors live, how old are they, etc.?
- What websites send traffic to your website?
- How many visitors have you converted to leads?
In short, GA can give you a complete overview of your website’s traffic and performance and help you achieve business goals.
Everyone from individual bloggers to big corporations uses some web analytic solutions, and Google Analytics is one of the best ones (and it’s free, which is always a plus).
Every website has some goals the owner wants to achieve.
For a personal blogger, that may be the desire to share knowledge and connect with like-minded individuals. For a business, it may be to drive traffic and generate leads. Whatever your goal is, you need to understand your visitors so you can serve their needs better. Without this information, you have no way of knowing how close you’re to achieving your goals.
How does Google Analytics work?GA tracks visitors to your website by storing and retrieving data through browser cookies.
You first need to add a snippet of code to your website so it can gather data on how your website is performing.
Whenever someone lands on your website, they are tagged by the tracking code, and their “session” begins. As long as they’re on your website, their data will be collected and available for you to look over.
You’ll be able to tell you:
- how they found your website,
- how long they stayed,
- what content they read and so on.
The tracking code should be placed on every page of your website if you want to track everything accurately. This will make sure that every visitor is adequately tracked as he moves from one page to another.
Data collected by GA tracking code includes essential metrics, such as:
- Page views: total number of times your website’s pages are viewed.
- Sessions: the number of individual visitors your websites receives
- Traffic source: where your visitors come from (Google search, social networks, etc.)
- Bounce rate: the percentage of the visitor who came to one page and left immediately
- Session duration: how long the visitor has stayed on your website
One of Google Analytic’s primary functions is creating goals. Goals are events that your website visitors may complete and are then trackable by GA.
Google Analytics goals
You can track things like:
- visits to specific webpages,
- submitted contact forms,
- purchases on the website.
For example, if you have a webshop, you may want to track how many users reached the checkout page, how many completed the purchase and how many contacted you.
Following goals results will show you which users are converting more, depending on their web source, or country or any demographic indicator.
This will help you determine how to optimize your website for the best conversion rate results toward those users.
To set up a Google analytic goal go to Admin>Goals. Once your goals are set up, go to Goals>Overview to track them.
Goals will also help you with tracking key performance indicators (KPI). Some of the KPI-s are already tracked by Google analytics by default, and others should be defined manually as goals.
Some of the most common KPI-s are:
- Number of unique visitors on a website
- Number of sessions
- Number of generated leads
- Number of generated sales
The desired KPI-s should be determined before any web marketing activities and should be compared with accomplished stats in Google Analytics on intervals.
How to install Google Analytics on your WordPress site?First, you need a Google Analytics account. If you already have a Google account, use it to log in Analytics (link). If you don’t have a Google account, go ahead and create one.
When you click on sign in to Analytics and select an account to use, you will be taken to a three-step process to create your Analytics account.
After you click Sign Up, you will have to fill out some basic info about your website. The important thing here is to set up your properties. A “property” is your website or mobile app.
You can have up to 50 properties under one Google Analytics account. For the sake of this guide, we’ll assume you only have one website and one feature.
Once you have set up everything, it’s time to install the GA code on your website. Click on “Get tracking code” button, and you’ll be taken to a page with your tracking code and instructions on how to install it.
There are several ways you can do this, but I recommend choosing between these two:
- install the code manually
- use a WordPress plugin to install the code
To do this, log in your WordPress dashboard and click on the Appearance>>Editor. In the Theme editor, look for header.php on the right side of the screen.
Install the code manually
Click on that, and you’ll see a block of code (that’s your website’s header). Find the part of the code that looks like this: <body> and paste the code behind it (anywhere before the </body> tag).
This will make sure the GA tracking code is installed in your website’s header. And since your header is a part of every page on your website, this means that the code is applied to the whole website.
Click on the Update button and leave WP dashboard. To check if the tracking code is working, go to Analytics dashboard and click on “Check tracking code status.” You will receive a notification if everything is set up correctly.
If you don’t want to install the code manually, you can always use a third-party WordPress plugin to add it to your website.
Use a WordPress plugin to install the code
There are many plugins you can use, but not all of them are entirely reliable. However, a great plugin that can make your life easier is Google Analytics by MonsterInsights.
This plugin allows you to install the code easily through its interface. First, install the plugin by downloading it from the link above, and upload it to your WordPress site through Add new plugin>>Upload.
Or, go to the same place, search for the plugin and click install. When it installs, set it up by following the instructions. You’ll have to go to the Settings page and authenticate your Analytics account.
After you click this, log in with your Google account and copy the code you receive in the field in the plugin settings page. That’s it; you have Google Analytics installed on your WordPress site.
I have shown you what information about your website you can get by using Google Analytics, and how you can benefit from it.
Wrapping things up
The information you get from GA can be crucial when you’re trying to see how many of your website’s goals have been achieved. Google Analytics is the most powerful free analytics solution available. It’s easy to set up and use, and I recommend it to everyone who has a website.
If you have any questions about how to set up Google Analytics on your WordPress website, or you need help with analyzing your website’s performance, please contact us today, and we’ll help.
Best practices for building a website mockup and prototype
Often, things we imagine in our heads that seem great regularly turn out to be bad ideas when we put them in the real world, such as a piece of paper or a computer screen. They say that the picture is worth a thousand words. What if this is not just a picture but a…
Favicon: How it Impacts Web Design
We can find icons everywhere in our everyday lives: from road signs, store logos, to our laptop keyboards. Images help us interpret information better. Since getting the right information as fast as possible is crucial when dealing with internet technologies, it’s no wonder that icons are an integral part of web design, as well.In this…
Website Logo Mistakes – And How to Avoid Them
The logo is arguably the most essential aspect of any brand to get right. It’s purpose is to show the personality of a brand and instantly convey what the company does at a glance.Website is the first place where your logo is presented to customers. It is the most critical place for your logo to…
Elements of Good SEO Check
SEO Check is an audit process to check all elements important for the search engine ranking. It is essential to perform this process to better understand what improvements need to be made to realize the full potential of your existing content.There are few different elements that need to be reviewed and evaluated. As a result,…