InfoPhilicWordPressHow to Install Google Analytics in WordPress Using MonsterInsights

How to Install Google Analytics in WordPress Using MonsterInsights

Making an ideal user experience for your site’s users isn’t a precise science, however focusing on specific performance metrics can give you direction for how to increase their traffic and user retention.

Here’s is when web analytics plays a vital role. When it comes to getting detail insights on your website/blog, web analytics offers your visitor’s data so that you can put your efforts to optimize your content based on users’ interest.

Key benefits of web analytics:

  • Supports the qualitative research and testing.
  • Encourage a data-driven environment for decision making.
  • Provide insights with the data.
  • Offers information on Traffic referrals.
  • Helps in improving ROI by doing behavioral Analysis of Visitors over time.
  • Understanding customer demographics.

While there are different web analytics tools you can use to gather, analyze and visualize your site information. However, the most well known that one should use is Google Analytics. You can integrate Google Analytics code into your blog/ site.

Google Analytics is a web analytics service offered by Google to help you understand your website visitors. It shows you the amount of traffic your website is getting, from where it is coming and how visitors interact with your site once they arrive.

The tool works by gathering data on how your site is performing, then saves that data to your Google Analytics dashboard. Every time when users come to your site in their web browser, they are tagged by the tracking code and their “session” on your website begins.

This data is particularly valuable in figuring out which of your marketing strategies is the best. It is additionally valuable for figuring out what kinds of users are visiting your site and why.

Getting started with Google Analytics:

Visit https://www.google.com/analytics/ and sign in with your Gmail account.

Google login page screenshot
Google login page screenshot

After signing in you will see the Sign-Up screen for Google Analytics.

Sign up for Google Analytics. It's easy and free!
Sign up for Google Analytics.

Click on Sign up button. You will be given with choice to choose between a website or a mobile app. Select for the Website. Once you selected the website, a screen will appear that will ask for your account details such as your account name, domain name, domain URL, company category and time zone.

Create a Google Analytics account
Create a Google Analytics account

Fill this information, click on Get Tracking ID button. A document with ‘Terms and Conditions’ will appear. Read the document carefully and click on I Agree.

You will get your Tracking code on the screen. Copy the code and paste it in your notepad (temporarily), as you will need it while installing Google analytics in your WordPress.

Google Analytics tracking code
Google Analytics tracking code

Now, you have successfully done with setting up a Google Analytics account.

Note: Do not close the tab as you may need to revisit it.

The next procedure is to install Google Analytics to your WordPress site/blog.

How to install Google Analytics to your WordPress?

There are two ways to set up Google Analytics in WordPress. I will show you the complete process for each method.

1. Install Google Analytics in WordPress Theme:

If you prefer to add Google Analytics to WordPress without a plugin, then its quite simple to add it using header.php file and function.php file.

a. Using the header.php file:

Edit the theme’s header.php file and paste the analytics code right before the closing </head> tag.

Adding Google Analytics code in header.php file
Adding Google Analytics code in header.php file

Save the changes and re-upload the file back to the server.

b. Using function.php file:

Another way is adding analytics code to function.php file. To do so,

  • Edit the function.php file in your WordPress theme.
  • Add the following code at the bottom of code in the file:
<?php

// Do NOT include the opening php tag
add_action('wp_head','google_analytics', 20);
function google_analytics() {
?>

/* --- PASTE YOUR GOOGLE ANALYTICS CODE HERE -- */

<?php
}

Do not forget to replace /* --- PASTE YOUR GOOGLE ANALYTICS CODE HERE -- */ with your Google analytics code.

After adding this code, check and ensure that your website’s reports are appearing on the Google Analytics dashboard.

How to view a site report on Google Analytics?

To view site report you have to visit your Google Analytics Dashboard.

Google Analytics report dashboard
Google Analytics report dashboard

You will see different sections divided into different tabs. You can check detailed web analytics for your site by clicking on the options.

2. Install Google Analytics for WordPress by MonsterInsights:

MonsterInsights is a Google Analytics WordPress plugin that enables you to effectively add, modify, and manage the Google Analytics site tracking services on your WordPress site. Basically, it makes tracking your site with Google Analytics easier and you can read all reports right into your WordPress dashboard.

The plugin is available in both versions: free and premium.

I would suggest using the premium version of the plugin as it offers advanced features such as:

  • Anonymize IPs so traffic from countries with stricter privacy regulations can be tracked.
  • Popular post/page tracking.
  • Track custom dimensions like page views per author.
  • AdSense tracking.
  • Create custom reports.
  • eCommerce Tracking
  • Download Tracking
  • Enhanced Link Attribution
  • Forms Report

Let’s move forward:

Step 1: The primary thing is to install and activate the MonsterInsights plugin.

Installing MonsterInsights Plugin
Install and active MonsterInsights Plugin

Step 2: After activation, the plugin will start the installation wizard. Follow the steps to complete the setup. You can Exit Setup to if you planning to configure it manually.

MonsterInsights setup wizard
MonsterInsights setup wizard

Step 3: First, select the category best describes your website and click on the ‘Save and Continue’ button.

Connect Google Analytics + WordPress
Connect Google Analytics + WordPress

Step 4: The next step is to connect the MonsterInsights to your website by clicking on the ‘Connect MonsterInsights’ button.

Step 5: A pop will appear where you will be asked to log in or select your Google account (if you are already signed in).

Choose your Google Account to connect MonsterInsights
Connect Google Analytics + WordPress

Step 6: You will then asked to allow MonsterInsights to access your Google Analytics account.

Give Google access to MonsterInsights Plugin
Give Google access to MonsterInsights Plugin

Step 7: By clicking on Allow, you will be redirected to the screen where it will ask you to select the profile you want to track.

Complete Authentication
Complete Authentication

Step 8: From the dropdown field, select your project for which you want to track the data. Now, click on the ‘Complete connection’ button to continue.

That’s it, you have done with installing Google Analytics via MonsterInsights on your WordPress website.

From that point onward, it’ll settle the authentication procedure in a few seconds, and afterward return you to your MonsterInsights setup page.

Step 9: The next step includes the selection of the recommended settings for your website.

Recommended settings for MonsterInsights
Recommended settings for MonsterInsights

This page includes some of the most important settings as the following:

  • Events tracking
  • Enhanced Link Attribution
  • File Download Tracking (doc,exe,js,pdf,ppt,tgz,zip,xls)
  • Affiliate link tracking

These settings are enabled by default as the default settings would work for most websites.

Affiliate Link Tracking: If you use an affiliate link and wanna track clicks on it, at that point you have to add the way you use to cloak affiliate links.

MosterInsights Advanced Settings

You can access Advanced settings by clicking settings option under the Insights Menu on WordPress dashboard navigation.

MonsterInsights Advanced Settings
MonsterInsights Advanced Settings

Choose who can see the Monster Insights’ reports. Here, you can add multiple roles including Author, Editor, Moderator, etc. You can also add roles to allow your team to configure plugin settings.

The best part of the plugin is, it allows you to exclude some user roles from being tracked in Google analytics.

Allow Automatic Plugin Updates: You can enable or disable the option to install updates automatically.

Automatic Updates for MonsterInsights
Automatic Updates for MonsterInsights

Let’s check out some recommended Add-ons.

If you are using the premium version, it will appear a list of add-ons. Some of them are as follows:

MonsterInsights Facebook Instant Articles: Track visitors from Facebook Instant articles.

MonsterInsights AMP: Tracks visitors on the AMP version of the site.

Forms: You can enable tracking of your form views, submissions, and conversion rates.

Google Optimize: Easily enable Google to Optimize in your WordPress site.

MonsterInsights form Insights: You can see important metrics for individual posts/pages in your WordPress Dashboard.

MosterInsights Report

As I mentioned before, you can easily check your analytics reports without leaving the WordPress dashboard. The report shows all the important metrics right into the WordPress dashboard.

MonsterInsights Report
MonsterInsights Report

Conclusion:

That all you have to do to add Google Analytics to WordPress. Keep in mind, it will take Google Analytics sometime before showing your details. Depending on the size of your website, it can take between a few hours to 24 hours.

You'll also like:
Continue to the category
Amit Malewar
Amit Malewarhttps://www.infophilic.com/
Amit Malewar has been the tutorial writer since 2013. His passion for helping people in all aspects of technology flow through the expert coverage he provides. In addition to writing for InfoPhilic, Amit loves to read and try new things.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

GET STARTED
DEALS

WP Rocket

Get 30% discount on WP Rocket plugin Now!
spot_img