How To Install Google Analytics To WordPress [2 Methods]

After creating a website, the first thing people do is to install Google Analytics on their website.

But adding Google Analytics is a bit difficult.

Here I’ll show you how you can add Google Analytics in your WordPress site with two simple methods.

After reading this article, you’ll know about the Importance of Google Analytics, how to add Google Analytics with a plugin, and without a plugin. So let’s get started,

Importance of Google Analytics

Google Analytics is the most popular and fastest-growing traffic analysis tool, with a usage of 55.3% and a market share of 84.2%.

Google Analytics provides valuable insights about your site and helps you to succeed in your business.

Here are some reasons why you need to add Google Analytics on your site:

To know the age, gender, device, interest, and location of your users

With Google Analytics, you can get valuable data about your users like the age, gender, which device they use, their interest, and their location.

By getting these types of data, you can know what types of users come to your site.

With knowing the average age and gender of your users, you can optimize your site accordingly, and you can target those people on different social media platforms.

After knowing the interests of your users, you can put such types of content on your site and optimize your site.

With Google Analytics, you can know which device your users use and with this, you can make your website fully responsive.

If you want to run ads for your site, then Google Analytics’ location tracker is best for you. Not only the location, but you can also know the language of the people.

To know what people do on your site

You can track where the users are going on your site, how much time they spend on your site, what is the most popular content on your site.

With getting all of these, you can decrease your bounce rate.

To know how people find your site 

Google Analytics helps you to know how people find your site. Like they come from Search Engines, Referral Links from other sites, or direct links.

Suppose if your site’s most of the traffic comes with Facebook, then you need to focus on Facebook marketing.

To create custom reports and set goals

With Google Analytics, you can create custom reports. If you want to improve your business, want to increase your site traffic, then custom reports may help you.

To create custom reports, you need to pick dimensions (For example, City and Browser) and metrics (For example, Sessions, Pageviews, and Bounce Rate) and decide how they should be displayed. You must specify at least one dimension and one metric.

You can set goals that will help you to track the users’ journey based on their actions.

You can set goals like newsletter subscription, downloading something, making a purchase, etc.

To know how people interact with your content

Google analytics shows how your users interact with your site’s content. It shows you what percent of the user clicked on which link on your site and much more.

Conversions and Sales

If you have an eCommerce store, then Google Analytics can help you track your conversions and see how much revenue your store is making.

Easy integration with other tools

You can integrate Google Analytics with other tools like Search Console, Google Ads, Google Tag Manager, and many more.

Google Analytics helps you to focus on the metrics that matter, so you can improve the performance of your website and increase conversions.

Create an account in Google Analytics

Google Analytics is completely free. To create an account on Google Analytics, you need a Gmail account. So let’s follow my steps below,

Step- 1. Go to Google Analytics and click Sign in to Analytics or Strat for free.

Google analytics sighup btn

Now login into your Google account, if you don’t have an account create an account.

Step- 2. After sign-in with Google account, you’ll be redirected to the welcome screen. Here you need to click Set up for free.

Google Analytics signup

After that, you will be asked to provide an account name. This name will be used internally, so you can use anything like your business name. And check all the boxes and click Next.

Google Analytics account setup

Next, you need to choose the ‘Web’ option.

Google Analytics measure types

After that, you need to enter your website name, website’s URL, select your category and time zone, and click Create.

Google Analytics poperty setup

In the last step, you will be presented with Google Analytics terms and service which you must agree to, so click on the I Accept button.

Once you accept the terms and conditions, you can see the Tracking ID and the tracking code to enter on your WordPress website.

tracking id google analytics

You can also simply leave this browser tab open and switch back to copy the code when needed.

Now you’ve successfully created Google Analytics account for your site.

Install Google Analytics using a Plugin (Recommended)

Adding Google Analytics using a plugin is the easiest method. But finding the best Google Analytics plugin that matches your needs is a bit difficult.

But you don’t need to worry about finding a Google Analytics plugin. Here I’ll show you the best Google Analytics plugin for WordPress.

MonsterInsights, yes, MonsterInsights is the best Google Analytics plugin for WordPress.

With the active installation of 2million+, MonsterInsights is the No.1 Google Analytics plugin for WordPress.

There are many reasons why you need to use MonsterInsights on your site.

Also, MonsterInsights allows you to easily add, customize, and manage the Google Analytics website tracking services on your WordPress site.

MonsterInsights has two versions one is free, and another is premium.

In this tutorial, we’ll be using the MonsterInsights free version. But if you want advanced tracking features, then you need to buy the premium version.

Analytics Dashboard, Page Insights
eCommerce Track, Forms Track
MemberPress, WooCommerce
Affiliate Link, Outbound Link Track
File Download Track, Author Track

So let’s get started.

First, you need to install and activate the MonsterInsights plugin. To do that login to your WordPress dashboard, click Plugins > Add New, search for ‘MonsterInsights’, and then click Install Now and Active.

After the plugin is Activated, the setup widget will appear. If the setup widget doesn’t appear, please click ‘Insights’ to your WordPress admin menu.

1st. Select your category and click ‘Save and Continue’.

MonsterInsights Startup Widget

2nd. Next, you need to click on the ‘Connect MonsterInsights’ button.

MonsterInsights lite setup

3rd. Select your Google account to continue authentication.

choose your google account to connect with monsterinsighs

4th. Allow permissions.

allow monsterinsights to connect with google analytics

5th. After that, you’ll need to select a profile. If you’ve multiple websites connected to your Google Analytics account, then you’ll need to choose the right website property here.

So choose your profile and click ‘Complete Connection’.

pick a profile from google analytics account

6th. Now you can see some recommended settings for Google Analytics.

mi recommended settings select

As you scroll down, you’ll see more settings.

mi recommended settings for dimension

The default settings would work for most websites. If you use an affiliate link plugin, then you need to add the path you use to cloak affiliate links. This will allow you to track your affiliate links in Google Analytics.

So, Review and configure these recommended settings, and then click the ‘Save and Continue’ button at the end.

7th. In the next screen, you can see some recommended addons for MonsterInsights, but these only for premium users.

monsterinsights recommended addons

8th. On the Next page, you can see some recommended plugins for MonsterInsights, if you want you can install those or skip those.

mi recommended plugins

9th. Click ‘Finish and Exit Wizard’

finish monsterinsights setup

Now you have successfully set up MonsterInsights on your site.

Install Google without a plugin

If you don’t want to use a plugin, then you can add Google Analytics with a tracking code.

Here you need to add your Google Analytics tracking code in your theme’s ‘functions.php’ file.

If you go the manual route, you must use a child theme so that your tracking code won’t be overwritten every time you update your WordPress theme.

Now copy your Analytics code and go to your site’s Appearance > Theme Editor. If your child theme is inheriting template files from its parent, you won’t see ‘header.php’ here. You can click on the name of your parent theme in the file list to access it.

WordPress child theme editor

Once you’ve found and selected header.php, paste the Google Analytics Tracking Code right before the </head> tag in the Editor:

WordPress header template code

In the end, don’t forget to click ‘Update File’.

Now you have successfully added Google Analytics on your site.

If you want to know more about MonsterInsights, you can read our MonsterInsights Review.

Also, read this article to learn Google Analytics and CCPA – what’s the issue?

Frequently Asked Questions (FAQs)

Does WordPress have built in analytics?

No, WordPress doesn’t come with built-in analytics, so for analyzing your site you’ll need to install Google Analytics.

Is Google Analytics Free 2020?

Google Analytics is a freemium service. There’s a free and a paid version of Google Analytics (called Analytics 360). Small and medium-sized businesses will likely get all the features you need from the free version.

If you have any questions about this article you can ask in the comment section. And if you like this article, don’t forget to share it.

Newsletter Updates

Get freebies, and special offers delivered directly to your inbox.

Leave a Reply

Your email address will not be published.