How to Install Google Analytics in WordPress for Beginners 01

Few things are more important when it comes to optimizing and marketing a website. Like knowing your audience and their interaction with your content. This data can help you make practically every business decision. That’s why installing Google Analytics in WordPress is a good option.

Learning how to integrate GA into WP is an essential component of running a website. The GA program may provide you with crucial insight into what is and isn’t working on your site. This allows you to make educated decisions about its future.

Many WP users struggle to link Google Analytics to their sites, and as a result, they miss out on valuable user data.

Fortunately, there are some options for integrating Google Analytics with WordPress. These practices are quite simple once you know what you’re doing and can be effective in a variety of scenarios.

In this article, we’ll go over what Google Analytics is and why it’s important for your website.

A Brief Overview of Google Analytics

It’s vital to understand what Google Analytics is and how it works before linking it to your WP blog. In a nutshell, this platform tracks the activity on your website and gives you useful information to help you improve it:

GA collects a wide range of data by inserting a code snippet into the header of each of your site’s pages. This may be classified into five categories:

  • Realtime. It shows what’s going on on your site at the time you’re looking at the report.
  • Audience. Shares Information about who is viewing your website, including demographics.
  • Acquisition. Describes how your website gets visitors.
  • Behavior. Displays what your visitors do on your sites, such as button clicks and the most popular pages.
  • Conversions. An advanced report that works with GA Goals to measure activity like email list subscriptions and e-commerce sales.

The following are some instances of specific data you could encounter in your GA reports:

  • At any given time, the number of active users on your site.
  • Over time, how many people visit your site?
  • The ages, genders, and locations of your visitors.
  • From whence do your visitors come? (e.g., organic search, social media, etc.).
  • What pages do visitors look at, and how long do they stay on them?
  • Bounce, click-through, and conversion rates are all important metrics to track.

In your Google Analytics dashboard, there’s a lot to see and learn. This might assist you in a variety of ways as you work to develop your website.

What are the Benefits of Google Analytics for Bloggers?

When you first start a blog, your primary goal is to increase traffic and subscriber numbers. By displaying the statistics that matter, GA assists you in making data-driven decisions. As shown by the following:

Who visits your website?

This section of statistics tells you where your audience is from and the browser they used to access your site. It also shows other relevant details like:

  • Screen resolution
  • JavaScript support
  • Flash support
  • Language, and more

This information is incredibly beneficial, and you may use it in a variety of ways. You can use user data to ensure that your site is compatible with your target audience while getting a custom design.

If the majority of your users don’t have Flash installed, you should avoid including it on your site. If the majority of your consumers are using screen resolutions of 1280 pixels or lower. Make sure your design works with that resolution or lower.

When users visit your website, what do they do?

You can see where your visitors go on your website, how long they remain there, and what your bounce rate is.

You can lower your bounce rate and improve your pageviews by using this data.

You may also see which articles are the most popular, which ones aren’t, and what kind of content your users are looking for.

What are the most preferred hours for users to visit your website?

You can choose the time to publish your content by looking at the busiest hours of the day for your site. If that time zone is not right for you, you can schedule your post to be within that hour.

What is the best way to find your website?

This part of the statistics reveals the origins of the users. For example, Direct links, Search Engines, and Referral links from another site.

It also tells you how much of your traffic came from each of these sources. Each of these categories is broken down by GA. If it’s the search engine category, it’ll tell you which search engine drove the most traffic to your site. Google, Yahoo, and Bing are all search engines.

The breakdown of referral sources reveals which sites you should focus your efforts on the most. If Facebook is your primary referral source. You must have exclusive Facebook content to make your viewers feel special.

If your best referral source is an external website, think about having a partnership with that site.

How do people respond to your content?

Google Analytics displays how visitors interact with the content on your website. It shows you how many users clicked on specific links on your site and much more.

You may do A/B split testing in GA by generating content experiments to learn what works best for you.

You may work your content around your consumers by observing their engagement. Now, you can focus on the methods that work for your site and avoid those that don’t.

End the guesswork and focus on the statistics that matter to make data-driven decisions.

Use the Data to Improve Your Website

What can you do with this information? Knowing the above allows you to do a variety of things, including:

Adjust your website to better serve your audience. For example, you may improve your site’s technical components or add a language.

Improve traffic sources. Increase your investment in those that perform particularly well. Or increase your efforts in those that do not.

Increase the quality of your content and content strategy. Give users more of what they want and post it when they’re most likely to be on your site.

Track marketing campaigns. Check to see if your efforts are paying off, as well as product sales and other types of conversions.

Identify your weak-performing pages. This enables you to take action to improve them.

In brief, web analytics removes uncertainty. They allow you to make decisions about your site based on facts and hard data rather than gut feelings or assumptions. Furthermore, because GA is free to use, it does not contribute to website expenses.

GDPR with Google Analytics

The European Union has recently adopted new privacy standards known as the GDPR. They aim to preserve consumer privacy and apply to anyone:

  • Operating in Europe
  • Doing business or advertising in Europe
  • Collecting data on European consumers
  • Employing individuals in the EU

Because GA collects a large amount of data, the new legislation will undoubtedly have an impact on it. So, if you’re going to use it on your WordPress site, you must do so in a way that complies with the rules. Fortunately, there are many resources on the subject to help you.

How can I get started with Google Analytics?

Google Analytics is completely free, and all you need to sign up is a Google or Gmail account. The sign-up process is straightforward. Follow these instructions to set up your Google Analytics account.

Step 1: Go to Google Analytics and sign up for an account. You’ll be asked to sign in using your Google account. You can sign in using your Google or Gmail account if you already have one. Otherwise, you can go ahead and establish your own Google account.

Install Google Analytics in WordPress

Step 2: After signing in with your Gmail account, you’ll see a screen like the one below. With your Gmail account, you can sign up for Google Analytics here.

Google Analytics Image

After that, you’ll be asked to choose a username for your account. This name will only be used internally. Thus it can be anything like your company name.

Image shows Create account

Step 3: On the next screen, you’ll have the option of choosing between a web, applications, or both web and apps. Make sure you choose the ‘Web’ option.

Image shows Analytics list

Following that, you must provide the website’s name, URL, country, and time zone.

Image shows the website's name, URL, country, and time zone.

Click the Next button after entering this information. You’ll be provided with GA’s terms and conditions, which you must accept by clicking the “I Agree” button.

Step 4: Your Google Analytics tracking code will now be displayed. You can copy this tracking code because depending on the option you pick below, you’ll need to paste it into your WordPress site.

You can also leave this browser tab open and return to it when you need to copy the code.

Image shows Analytics code

Once you’ve installed the code on your WordPress site. We recommend leaving the analytics browser tab open in case you need to return to it.

Let’s look at how to install Google Analytics in WP now that you’ve set up a Google Analytics account.

Google Analytics in WordPress: How to Set It Up?

In WordPress, there are a couple of different ways to set up Google Analytics. We’ll show you three approaches. The first being the simplest and the last being difficult.

You can select the one that meets your requirements.

Note: To avoid double tracking of page views in your Google Analytics account. You must only use one of these methods on your website.

Method 1: MonsterInsights’ Google Analytics for WordPress

The most popular Google Analytics plugin for WP is MonsterInsights. Bloomberg, PlayStation, Zillow, WPBeginner, and others are among the websites that use it.

It is the simplest and most effective method for integrating GA with WP.

MonsterInsights is available as both a paid premium plugin and a free version. We’ll use the MonsterInsights free edition in this guide.

You can use the MonsterInsights Pro edition if you want more advanced features. Such as E-commerce tracking, Ads tracking, Author tracking, etc.

The procedure for putting them together is the same.

Let’s get it started.

Installing and activating the MonsterInsights plugin is the first step.

After activating the plugin, it will add a new menu item to your WP admin menu called ‘Insights.’

The MonsterInsights setup wizard will open when you click on it.

Image shows MonsterInsights setup wizard

It will ask you to select a category for your website first (a business website, blog, or online store). Choose one, then hit the ‘Save and Continue button.

After that, select the ‘Connect MonsterInsights’ button.

Image shows 'Connect MonsterInsights' button.

This will open a window that will prompt you to sign in or select a Google account if you are already signed in.

Image shows Select google account

Next, it will prompt you to grant MonsterInsights access to your GA account.

Image shows MonsterInsights access to your GA account.

To proceed, click the ‘Allow’ option.

The last step is to choose which profile you wish to keep track of. To proceed, you must first select your site and then click the ‘Complete Connection’ button.

Image shows 'Complete Connection' button.

GA will then be installed on your website. After that, it will ask you to choose your website’s suggested settings.

Image shows website's suggested settings.

Most websites would be fine with the default settings. You must add the path you use to cloak affiliate links if you use an affiliate link plugin. You’ll be able to track your affiliate links in Google Analytics as a result of this.

To save the settings, click the Save and Continue button.

Then, if you upgrade to PRO, MonsterInsights will show you paid add-ons that you can use. To skip this step, click the ‘Save and Continue’ option.

Image shows 'Save and Continue' button

Following that, it will ask you to install WPForms, the best WordPress contact form plugin. You can either install it or select the ‘Skip this Step’ button.

Image shows 'Skip this Step' button.

You have now successfully installed and set up GA on your WordPress site. Remember that Google Analytics will take some time to display your statistics.

Image shows finish setup button

The best thing about MonsterInsights is that it allows you to view your GA reports right from your WordPress dashboard. To get a fast summary of your analytics data, go to the Insights » Reports page.

Image shows Overview report

It also includes a Popular Posts plugin. This allows you to highlight your best-performing content to increase traffic and pageviews.

Image shows MonsterInsights

You can use it to automatically add popular post links inline to increase engagement:

If you have an online store, it can also automatically include your best-selling items at the end of each blog post to increase sales.

Image shows analytics progress

Method 2: Insert Headers and Footers Plugin

You won’t be able to do advanced tracking configuration or access GA data in your WP dashboard. Due to which this solution isn’t as good as MonsterInsights.

To begin, copy your GA tracking code, which you copied in Step 4 when you signed up for a Google Analytics account.

Image shows Tracking code

The Insert Headers and Footers plugin must then be installed and activated.

You must go to the Settings » Insert Headers and Footers page after activation. The GA tracking code that you copied before into the ‘Scripts in headers’ section must be posted here.

Image shows Scripts in headers

Don’t forget to save your changes by clicking the Save Changes button.

You’ve now installed Google Analytics on your website.

Method 3: Install Google Analytics in WordPress theme.

Only advanced users should use this method who are already familiar with the code. It’s unreliable since your code will vanish if you change or update your theme. This is a method that we almost never recommend.

To begin, copy your GA tracking code, which you copied in Step 4 when you signed up for a Google Analytics account.

There are two popular methods for including this code in your WordPress theme files. You have the option of selecting one of them (not both).

Insert the code in the header.php file.

Go to your WP theme’s header.php file and paste the GA tracking code you copied before right after the <body> tag.

Remember to save your work and re-upload the file to your server.

 Insert code in the Functions File

The GA tracking code can easily be added to the WordPress functions file. It will then install the tracking code to every page on your WP site automatically.

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


add_action('wp_head', 'wpb_add_googleanalytics');

function wpb_add_googleanalytics() { ?>

// Paste your Google Analytics tracking code from Step 4 here

<?php } ?>

Method 4: Use Google Tag Manager to integrate Google Analytics with WordPress.

You may also use Google Tag Manager to integrate Google Analytics with WordPress. This is intended for sites that use scripts for a variety of reasons, not just analytics.

A tag management system is Google Tag Manager. It enables you to update tags and code snippets on your website or mobile app. Such as those for traffic analysis and marketing optimization, fast and efficiently.

Instead of editing site code in WP, you can add and change scripts through the Tag Manager user interface. This reduces errors and eliminates the need to work with a developer while configuring tags.

The best way to achieve this is to use the Google Tag Manager WP plugin, which is available for free. It has more than 300,000 active installations and a five-star rating:

Google tag manager image

The Google Tag Manager plugin is available for download from the WP repository. Or by searching for it in your dashboard under Plugins > Add New. After that, you’ll need to create a Google Tag Manager account and your first container.

After you’ve performed the following steps. Go to the Admin tab on the Google Tag Manager dashboard and look for a string of characters beginning with GTM:

Image shows Admin dashboard

Then, on the plugin’s settings page, paste your Google Tag Manager ID into the applicable space. To get there, go to Google Tag Manager > Settings > Google Tag Manager:

Image shows Google Tag Manager

Any tag you create in Google Tag Manager will now operate on your WordPress site.

Method 5: Using the Complete Analytics Optimization Suite to Sync Google Analytics Locally

To get started, we recommend using Daan van den Bergh’s CAOS. It is a free plugin he invented and developed. It has over 20,000 active installations and a five-star rating:

CAOS Image

You can get it from the WP repository or search for it in your WP dashboard under Plugins > Add New.

With the CAOS, you may host your GA JavaScript file (analytics.js) locally and use wp cron() to keep it updated. Other characteristics include the ability to:

  • Anonymize your visitors’ IP addresses.
  • Set a bounce rate that has been changed.
  • Change the Google Analytics script’s position (header or footer).

Before you can use it, you must deactivate any analytics plugins you already have installed.

CAOS provides the appropriate code for GA to your WP website when you install it and submit your GA Tracking ID. It then downloads and saves the analytics.js file to your server and uses a scheduled function in wp cron to keep it updated.

By heading to Settings > Optimize Analytics and selecting the Footer option under the position of tracking code. We recommend setting the script to load in the footer.

Image shows Footer option under the position of tracking code.

Note that CAOS does not operate with any other Google Analytics plugins.

Method 6: Using Perfmatters to Sync Google Analytics Locally.

Perfmatters is another plugin that you can use for local analytics. Brian Jackson and his brother Brett built this premium website performance improvement plugin:

Perfmatters Image

Among its many features is the ability to sync GA locally by inputting your tracking ID. Like CAOS, you can configure the script to load in your footer rather than your header.

Reports on the Google Analytics Website

Google Analytics is capable of displaying data gathered from your statistics. You may examine this information by going to your Google Analytics dashboard.

The built-in GA reports can be seeb in the left column. Each area is divided into tabs, and clicking on a tab expands it to reveal more possibilities.

Real-time This report will provide you with a live glimpse of your traffic.

The Audience tab will display reports to help you better understand your users.

Acquisition reports delve into the origins of your users.

Behavior reports explain what your visitors do once they arrive at your website.

Conversion reports reveal how well you’re doing in relation to your objectives.

How to Make the Most Out of Google Analytics

Google Analytics is a tremendously strong tool with a variety of fantastic features. Some are straightforward and simple to use, while others need some further preparation.

Here are some resources to help you get the most out of your Google Analytics reports.

You may use Google Analytics to track user interaction in WordPress.

You can also use Google Analytics to track WooCommerce customers.

In WordPress, you can track outgoing links.

WordPress Conversion Tracking Made Easy | Step-by-Step Instructions

Google Analytics works best when combined with Google Search Console. It shows you how your website is performing in search results.

We suggest using the AIOSEO plugin for WordPress. This is an all-in-one SEO toolbox if you want to boost your website’s SEO ranks and increase traffic.

Google Analytics and WordPress frequently asked questions.

Before we finish, let’s go through some of the most common questions about using GA on your WordPress site.

Is Google Analytics compatible with WordPress?

Yes! There are other ways to integrate Google Analytics with WordPress. But they all result in the same thing. Your WP site’s statistics will be collected and aggregated in the GA dashboard.

How do I install and configure Google Analytics in WordPress?

First, you’ll have to sign up for a free GA account. Then, using one of several techniques, you can integrate that account with your website.

A plugin is the simplest approach to integrate Google Analytics with WordPress. There are many solutions available, one of which being OrbitFox, a high-quality solution.

It is a free plugin that provides a basic GA connection as well as several other features for any WP site. Content optimization and extra blocks for the WordPress Editor are among them.

You can also manually install GA on your WP website by copying and pasting some code into your theme files. But, this strategy is riskier and less stable than using a plugin.

How do I integrate Google Analytics into my free WordPress blog?

You can use Google Analytics regardless of the sort of website you have. You can use the steps outlined above to set up Google Analytics and track your visitors if you have a free blog, a subscription site, or an eCommerce store.

What is the best WordPress Google Analytics plugin?

To install Google Analytics on WordPress, we recommend OrbitFox or MonsterInsights. The former is ideal for easy, straightforward integration. It’s free and comes with a slew of features, including Google Analytics integration. A content optimizer is among them, as are modules for the Block Editor and many page builders.

For Google Analytics integration, either plugin will suffice. It is simply an issue of comparing your needs against the expense.


Knowledge is power, whether your website is a hobby or a critical commercial asset. Few platforms provide as much information as Google Analytics. Integrating it with your WordPress website can help you increase visitors and revenue.

Google Analytics is an important tool for website owners and managers. But it is not the only analytics tool accessible.

Tracking user activity, referral sources, and other data on your site is critical for expanding your audience and brand. You can use the methods discussed in this post to link Google Analytics to your WordPress site.

We hope this article helped you to install Google Analytics in WordPress.

Load More Related Articles
Load More By jarrod
Load More In Digital Marketing

Leave a Reply

Your email address will not be published. Required fields are marked *