Home / Resources / WordPress / How to Set Up Google Analytics in WordPress
Google Analytics with WordPress

How to Set Up Google Analytics in WordPress

Are you looking to install Google Analytics in WordPress? In an online platform, it is not possible to interact with each and every user to get their feedback. But at the same time, it’s very important to keep an eye on the audience activity visiting your website. And act accordingly for improving the visitor’s experience.

The best part is you can track and get the website traffic reports for free by using Google Analytics.

Going through this article you will get to know how Google Analytics is crucial for your website. And a complete guide to link it with your WordPress website.

Let’s have a quick look at how we are going to take you through the complete guide of Google Analytics.

Table of content

The Importance of Google Analytics

For any website or blog, the first and most important aim is to increase the traffic and number of subscribers, especially if you have just started your blog/website. And taking your decisions based on relevant stats and data always helps you in moving in the right direction. Using Google Analytics you can get following important statistics.

Who Visits Your Website?

Knowing the geographical location of your visitors is very useful. Using Google Analytics you can know about the geographical location of your visitor, browser name, language, JavaScript support, screen resolution, etc.

This data is extremely useful while getting a custom design. You can analyze these data and make the changes accordingly if required in order to make your website more user friendly.

Suppose the data is showing that the majority of visitors of your websites are not enabled with Flash support and have low screen resolution. Getting these details will stop you from using flash elements in your site and adjust your website design for best user experience.

Track User’s Activities on your Website

Google Analytics provides you the details of the user’s activities who visit your website. This includes information such as the duration of users on your website and bounce rate, the percentage of visitors/users who came to the website, and left without any further action.

You can utilize this data to improve your website. For example, a Higher bounce rate has various negative impacts on your website.

Also you can see which of your articles is drawing good attention of the visitor and which is lacking to get the traffic. This helps you in knowing the type of content your audience is searching for and you can create more such SEO friendly content with the help of Yoast SEO Plugin

Visitor’s High Performing Time on Your Website

You can know the highest performing hour for your website in the day. So that you can post your article on that highest performing hour or schedule your post accordingly if the time zone is different.

How Peoples Find your Website

There are different ways such as direct links, search engines, referral links from other websites, etc through which people come to your website. 

Using Google Analytics you can get the stats of each source which shows the percentage of traffic they are bringing individually to your website. Analytics also provides further classification of each major category for more precise analysis. If Google Analytics tells you that you are getting more traffic from the search engines, then you can also see the traffic percentage coming from each search engine such as Google, Yahoo, Bing or any other.

Analytic reports provide data of well performing referral sources. So that you can start working on them more actively it may be facebook, linkedin, etc. You can customize your content exclusively for targeting the audience of that referral source.

Similarly, you can approach for partnership with those external websites which appear as top referral sources for you in Google analytic stats. Overall you can analyze these useful data and apply Best SEO Practices to generate maximum traffic for your website.

How Keep People Engaging with your Content

You should always avoid shooting an arrow in the dark especially when you have all the data. Google Analytics provides you important information such as which page or link of your website is getting how many clicks in terms of percentage, how visitors are navigating your website and other useful details.

Instead of guessing you can execute A/B tests or split run testing in Google Analytics. This helps you in approving the content experiments which go well with your targeted goals.

All such responses and activity from visitors are included in Google Analytics. These useful data and stats help you in creating your strategy in the right direction for improving users experience.

Sign Up with Google Analytics

For using Google Analytics you should have a Google or Gmail account and without spending a penny you can sign up because it’s free. To create your Google Analytics account just go through these four quick and easy steps.

Step 1.

Start with visiting Google Analytics sign up as you are new. Use your existing Google/Gmail account or create a new one to sign-in. Only Google or Gmail accounts are allowed as we mentioned above.

Google Analytics Sign Up

Step 2.

After sign-in you will be redirected to signup page where you need to fill the required details to sign up for Google analytics. You have to set an account name like your business name for internal use.

Google Analytics Create Account

Step 3.

The next step is to select the platform that is “Website” or “Apps”. We are going use Google Analytics for our WordPress site so we have to select the Web option.

GTA Worpdress Web

The next screen you will get the Property details. And you have to fill the Website Name, URL, category and the preferred timezone.

GTA WordPress Website

Next, click on the Create button and you will see the terms and services of Google Analytics. You need to get agree from all the given terms to proceed further.

Step 4.

In this final step, you will get a Google Analytics tracking code that you have to copy and use in your WordPress website. There are different verification methods and you can choose any one of them mentioned below. Meanwhile do not close your analytics tab so that you can revisit it after installing the code on your WordPress site.

Google Analytics WordPress Gtag

So your Google Analytics account set up has been completed, Now let’s proceed on installing Google Analytics in WordPress.

Methods to Install Google Analytics to WordPress

Google provides different options for setting up Google Analytics in WordPress. Here we are discussing two methods from which you can choose any one of your preferred method.

Add Google Analytics in WordPress with Plugin

This one is the most simple method, especially for beginners. Just install a WordPress plugin Insert Headers and Footers and activate it. Then go to Settings and click on Insert Headers and Footers option. You will get this type of interface as shown in the image below. Remember you copied a Google Analytic tracking code in step 4 just paste that code in the header section.

Insert Header Footer Plugin

Finally click on the save button and tada. Your WordPress website is now linked with Google Analytics.

Insert Google Analytics for WordPress without Plugin

If you have a little coding knowledge you can go with this method. However, this method is not a permanent installation because whenever you update or change your current WordPress theme your tracking code will get removed automatically. This means that you need to keep in mind that every time you update or change your theme you have to put the tracking code as described below. This one is the least suggested method and you should possibly avoid it.

Add Analytics Code to header.php

In your WordPress theme just edit the header.php file and paste the code after the <body> tag (same code which you copied in step 4). Save your changes and upload this file to your server.

Adding Code functions.php

In your WordPress functions file, you can put the Google Analytics tracking code and this tracking code will be added to all pages of your WordPress website automatically. Add the tracking code in function.php like this.

add_action('wp_head', 'wp8723_add_googleanalytics');
function wp8723_add_googleanalytics() { ?>
    // add Google Analytics tracking code
<?php }

Analyzing Reports on Google Analytics Website

Google Analytics provides you with the most important data and statistics  captured from visitors activity. Using Google Analytics dashboard you can view this useful data

In the left column, you will be able to find the in-built Google Analytics reports. Every option present in the dashboard has a few more tabs which can be expanded on clicking to view all other options.

  • Real-time reports provide the information activity or traffic occurring at the moment on your website.
  • Behavior reports gives you a summary of how visitors are navigating your website after landing on it.
  • Acquisition section provides information related to the source of the visitors they came from like search engines, referral links etc.
  • Audience section gives information about your visitors if you have grouped them based on sets of common attributes
  • Conversion reports are indicators of how you are performing towards your set goals.

We believe this article will assist you to install google analytics to WordPress. And if you enjoyed this article, then please follow us for more interested and helpful tutorials. You can follow us on Facebook and Twitter.