How to Add and Set Up Google Analytics?


Being able to know how visitors interact with your website is of great benefit. Google Analytics, as a helpful system used to track and analyze statistics of a specific website, can be your option if you want to know how many visitors there are, what visitors do, when and where they are from and how long they have stayed on your website and much more.

Please go on reading the following parts to know how to add and set up Google Analytics for your website.

How to Set Up Google Analytics?

To add Google Analytics to your website, you should set up Google Analytics first and follow the steps below.

Sign up for Google Analytics

First, you need to visit to sign up an account. If you already have a Gmail account, as it is indicated, you just need to enter necessary information to log in. If you don’t have one, you should then create a Gmail account.
Sign up for Google Analytics with a Gmail
After you have done that, you should go to “Sign Up” to sign up for Google Analytics.

Select Your Analytics Account

There are 2 tracking methods on the editing page, which are Website and Mobile App respectively. You need to choose one between them. Here, you can choose the “Web site” option.
Select your Analytics account
Meanwhile, you will see “Universal Analytics” and “Classic Analytics” accounts on this page. The Universal account is in beta and has more features than the other one. On the other hand, if you choose the Classic account, you can upgrade to new functionalities and features.

Complete Some Necessary Information

Now, you’re prompted to fill in some information as the following image shows. As for “Data Sharing Setting”, you can make a decision on whether or not to share Google Analytics data with others by selecting from these choices. Then, you should check the “User Agreement” to make sure that you have agreed to the terms and conditions. Finally, click “Create Account”.
Complete some necessary information

Add Tracking Code

Once done, you will be leaded to a new page where displays the HTML tracking code. Next, you need to copy and paste those codes to your WordPress website.
Add tracking code

How to Add Google Analytics to WordPress Site?

After you set up Google Analytics, it’s time to add it to your WordPress site using the provided tracking code. There are 3 methods you can use to do that.

1. Add Tracking Code to Header Directory

First, you should go to your WordPress Dashboard and click “Editor”. Here, you need to find the “header.php” file and paste the previous tracking code. Once done, click “Update File” to save the changes you made.
Add tracking code to Header directory

2. Add Tracking Code to Functions.php File

You can also add those tracking codes to the “functions.php” file which is located in the “themes” directory. To find the “funtions.php” file, you should go to /wp-content/ > /themes/ and find your presently used theme. Then unfold this directory and select the “functions.php” file.
Add tracking code to functions.php file-1
At the same time, don’t forget to paste the following codes. Note that if you’re not familiar with coding stuff, this method is not favorable.
Add tracking code to functions,php file-2

3. Put Tracking Code in Plugin’s Setting Page

No matter which Google Analytics plugin you use, if you want to add Google Analytics to your WordPress Site, you need to paste the code to the editing page of the plugin you use.

Once done, you should return to the Google Analytics browser and click “Save” to make it work.

Verify Whether Google Analytics is Properly Working

To check whether Google Analytics is tracking your site, you should go to Admin and click “Tracking Info”. If you find the “Tracking Status” is “Receiving Data”, then you have successfully added Google Analytics to your WordPress site.
Verify whether Google Analytics is properly working
If you want to take a look at your site’s analytics overview, you need to click “Reporting” located in the upper-side of the page.
View analytics overview


In general, using Google Analytics to interact with your visitors is an effective way to improve your site traffic and SEO ranking. Besides, a reliable and responsive online environment is also of great importance to the rank of your site. is standing out from a variety of web hosting providers for its fist-class web hosting service featuring high performance and unbeatable reliability and much more. You can rely on our mighty solutions to power your website.