How to add Google Analytics to WordPress 2020 [3 Easy Methods]

Here is a complete guide of how to connect or add Google Analytics to WordPress Dashboard using a plugin or manually. So I’ve added 3 methods of adding Google Analytics data on your WordPress blog easily.

To check your website’s analytics and visited users info.

You need to connect google analytics account to your blog.

There are 3 methods for how to How To Add Google Analytics in WordPress Site.

Adding Google Analytics in WordPress site will help to track visitors, their behaviour, what they are looking for, how they reach on your site and many more analyse possible with google analytics.


What Is Google Analytics

Google Analytics is a free website tracking service that reports website traffic, conversions, user behaviour, and more. It is the most popular website tracking service available.

Google Analytics Dashboard
Google Analytics Dashboard

Google Analytics can show you how much traffic your website receives, where that traffic is coming from, and how visitors interact with your site once they arrive. You can also export Google Analytics data in various formats or build your own custom “Dashboard” that easily provides and updates the data you want to see.

What You Can See On Google Analytics

  • Real Time Report: it provides a real-time report of your site that show traffic source, page views and much more
  • Page Views: The number of individual pages a visitor goes to on your site.
  • Sessions: The number of individual visitors your website receives.
  • Traffic Channel And Source: Where your site visitors came from (A Google search, a paid Google ad, another website, directly to your site, a social media network, etc.)
  • Bounce Rate: A measure of how many visitors came to one page on your site and then immediately left.
  • Session By Country: Check which country are loved your site and help to get the best affiliate programme
  • Session By Device: you can check your visitor’s device and operating system
  • Session Duration and Pages per Session: Measurements of how long someone stayed on your site and how many pages they visited during their Session.
  • Goals (sometimes referred to as “Conversions”): These are a measure of how many people completed an action on your site, as stipulated by you. For example, if you have a contact form, you could measure how many people filled out and submitted that form, where they came from, etc.

Is Google Analytics Important?

Yes, analytics is really important for every site to understand your customers. First, it’s free of charge for all but the largest websites. While the appeals to small businesses are obvious, it can also entice larger organizations that are piloting content marketing programs.

Add Google Analytics to WordPress Blog

There are many ways by you can add google analytics code into your site.

Google analytic provide script codes and this codes will be added in the head section of a website, in HTML website it is easy to add script code into head section but in WordPress, there are you cannot add google analytics code manually or without touching any WordPress PHP file.

So there are three best and easy ways to Add Google Analytics in WordPress Site.


#1 By WordPress Plugin [ MonsterInsights ]

By adding google analytics through the WordPress plugin is an easy method for all and there is no error made if you change the WordPress theme. By adding google analytics plugins you can also see analytic data into WordPress dashboard.

Add any google analytic plugin and activate it. in this article, I am using MonsterInsight plugin that is free or premium both and easy to use.

Even you can also upgrade this plugin plan to get more features and extra addon. To know more about its pricing and all features you can visit on MonsterInsight site.

But if you want to connect your Google Analytics to your WordPress site free and easily, You can also go with its free version. which also has some basic useful features.

Here below is a complete process of how to adding MonsterInsight plugin on your WordPress site and start using this.


Step:1 Install the plugin and activate it

The first thing that you need just Instal the MonsterIngisht plugin. To install this plugin just go to:

Plugins >> Add New >> Search “Monster”

After searching for this keyword or enter compete for plugin name.

Then click on Install button, After Install this plugin also active it.

Install a new plugin - MonsterInsights

Here in the above image, you can see that I’ve searched for a monster and then the result is, Install the plugin which has an arrow.

Just simply Install the plugin and then activate it.

After successfully install the plugin, now you’ve to connect your google analytics account with the MonsterInsight.

Install MonsterInsights


Step-2 Connect your Website

MonsterInsight has a complete step by step guide for new users and beginners.

Let’s start ➡

The plugin shows you a customization tab where you need to follow some steps of plugin.

First MonsterInsight will welcome you select your business or website profile. here 3 options are available:

  1. Business Website
  2. Personal Blog
  3. eCommerce

Now connect your website with MonsterInsight, for this click on MosterInsight blue button.


After clicking on the connecting button It will show you, your all signed-in Google account. Click on your account which is assigned with Google Analytics.


After selecting your Google account, It will ask for your permission. By allowing MonsterInsight, this plugin can see all your analytics data and analysis them.

For more details, you can see the options or points which will be taken by Monster Insights.

Simply click on the allow button.


While adding a site on Google Analytics we create a profile where we add our websites to check analytics data. When in last step you’ll click on allow button in next step it will show you all your google analytics profile and assigned websites with them

Just select your profile and website which you want to on this plugin. After selecting the right profile and website click on the complete connection.



You complete your customization wizard.

It will show you some notice, you should follow them to keep all WordPress function working well. Like here in the below image you can see It is showing me 3 notices which are for cache, subscription and time delay for data.

I hope you’ve connected your google analytical with the mosterInsight plugin.

After done this now you can see your Google Analytics data in the WordPress dashboard. It is a time-saving way, you don’t need each time to visit on Google analytics account.

Step-3 Check your Analysis Data

Now you can check and analysis, your whole google analytics data in WordPress dashboard using monster insight plugin.

To check your analytics data visit on Monster Insight plugin and then reports.

It will show you a dashboard layout and your important analytics data. Even you can also customize your home section and add new parameters there to get more info.

MonsterInsights Dashboard Plugin
MonsterInsights Dashboard

In the above image, you can see my analytics, which is a screenshot of MonsterInsight plugin.

So this plugin makes your work easy and shows you all imp data on the wp dashboard.


#2 By Theme Option

Mostly Premium WordPress theme provides their theme panel where user can change or customize theme options. in theme option there are can be custom codes options that allow adding custom code into the head section.

Here I am using Publisher Theme that provides me theme option where I can also add google analytics and javascript codes. so I am pasting my js code here.

How To Add Google Analytics In WordPress Site

you can also check your theme option and add analytics codes easily.


#3. By Function.php

You can also add Google Analytics tracking code to the WordPress functions file. It will then automatically add code to every page on your WordPress site.

You will need to add this code to your theme’s functions.php file.

For Adding in function file got to Appereance >> Editor >> Select Function.php file

add_action('wp_head', 'wpb_add_googleanalytics');
function wpb_add_googleanalytics() { ?>
// Paste your Google Analytics code from Step 4 here
<?php } ?>


Warning! If you change WordPress theme analytic code will be removed from the function.php file

So if you change your WordPress theme and have added analytic code through function.php, you should again add analytic code in a function.php file.


Wrap it, Adding Google Analytics to WordPress Site

I hope you like all my three methods which are easy and simple. Adding you google analytics code to WordPress site is necessary for tracking your visitors, check landing pages and extra data.

You can use any 1 method to connect your Google account.

But using MonsterInsight plugin is also a good idea because using this plugin you can also check your important analytics data at your WordPress dashboard.

You need to log-in in your analytics account, simply check it on your WordPress dashboard.


Related Articles:

Here are some more related articles for Blog Beginners.


Comments are closed.