Web Technologies that make Entrepreneur

How To add Google Analytics in WordPress Site[3 Methods]

0 1,147

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. in this article there are 3 methods for how to How To Add Google Analytics in WordPress Site.

What Is Google Analytics :

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

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 provide 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 best affiliate programme
  • Session By Device: you can check your visitors 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 is obvious, it can also entice larger organizations that are piloting content marketing programs.

Or Are you Looking For :

How To Add Google Analytics in Html Website

Add Google Analytics in WordPress

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 Theme Option

Mostly Premium wordpress theme provide their theme panel where user can change or customize theme options. in theme option there are can be custom codes options that allow to add custom code into head section.

Here i am using Publisher Theme that provide 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

#2 By WordPress Plugins

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

How To Add Google Analytics In WordPress Site

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.

Step:1 Install plugin and activate it

Install the MonsterInsight plugin and go to Setting Section of this plugin

Step:2 Google Authentication

Click on Authenticate with your Google account This will bring up a popup where you will be able to authenticate with your Google Account.

Step:3 Submit Google Code

Now you need to click on ‘Click to get Google code’ button.

This will bring up another popup with the message ‘Monster Insights would like access to your Google Analytics data’.

Click on the ‘Allow’ button to continue.

How To Add Google Analytics In WordPress Site

The authentication popup will now show you a line of code which you need to copy.

Next, you need to enter this code in the MonsterInsights popup and then click on ‘Next’ to continue.

The final step is to select the profile you want to track. You need to select your website here and then click on the next button to continue.

That’s all you have successfully installed and setup Google Analytics on your WordPress site.

The best part about MonsterInsights is that you can view your Google Analytics report on your WordPress dashboard. Simply visit Insights » Reports page to check out a quick overview of your analytics data.

How To Add Google Analytics In WordPress Site

#3. By Function.php

You can also add Google Analytics tracking code to 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 remove from 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 function.php file.

Here’s What You Should Read Next :

  • Custom Google Analytic Dashboard
  • Top 7 Best WordPress Analytics Plugins
How To add Google Analytics in WordPress Site[3 Methods]
Rate this post
Subscribe to our newsletter
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.