Beginners Guide How To

How to set up Google Analytics for WordPress – Step-by-Step Guide for Beginners

How to set up Google Analytics for WordPress – Step-by-Step Guide for Beginners
Written by Zaki

How to set up Google Analytics for WordPress – Step-by-Step Guide for Beginners

Do you want to set up Google Analytics for WordPress? Knowing how your visitors interact with your website is key to your success.

The best way to get to know your visitors is through your traffic statistics, and that is what Google Analytics provides for free.

This tutorial will discuss why Google Analytics is important for your WordPress website and how to quickly and easily install Google Analytics in the website complete (step-by-step) guide for free.


First, we will have to explain why Google Analytics is important and how it will help to grow your WordPress website.

Then, we will explain how you can sign up for a Google Analytics account. And will explain various methods for installing Google Analytics on your website.

In the end, we will have to explain how you can see your traffic reports in Google Analytics.

You can see a quick overview of what you will learn in this tutorial.

  • Why Google Analytics is an essential tool for your Site
  • How you can Sign up for Google Analytics for your Site
  • How you can Install Google Analytics to use Monster Insights
  • How you can Install Google Analytics to use Insert Headers and Footers Plugin
  • How you can Install Google Analytics in WordPress Theme
  • How you can View Reports in Google Analytics
  • How you can Make the Most out of Google Analytics

Let’s get started if you are ready.

You can also watch this video tutorial on How to set up Google Analytics for WordPress.

If you do not like watching a video tutorial, then you may have to continue reading the below article:

Why is Google Analytics Important for Bloggers?

When you start a blog, your # 1 goal is to gain more subscribers and traffic. Google Analytics always helps you make statistical decisions that are essential. You can view:

Who Visits your Website?

In this part, analytics answers about your website visitors’ geographical location and which browser the visitors used to visit your website.

And some other essential information like JavaScript support, screen resolution, language Flash support, and much more.

This data is beneficial, and it will help you in a lot of ways. While getting a custom design, you will use user data to ensure that your website is compatible with your visitors.

If your users usually do not have Flash support, you will need to avoid adding the flash element to your website.

If your users are usually on the screen resolutions of 1280, then ensure that your design is compatible with that resolution or smaller.

When People are on your website, what do they do?

You will also be able to track where the visitors are going on your Site. For how long they are staying on your website. And what about the bounce rate (the % of visitors who exit your website on the first visit).

Using this information, you will be able to decrease the bounce rate and increase your page’s views.

Your most popular articles also can be found, articles that are not doing very well, and what type of content your visitors are looking for.

When do people visit your site?

By looking at the hottest times of the day on your site, you can choose when to publish your post. If that time zone doesn’t match yours, you can schedule your post to meet this time.

How do people find your site?

This analytics section will also show you where the visitors came from (for instance, Direct Links, Search Engines, and Referral links from another website).

It will also show you what %age of your users came from each of these sources. Each of these categories, Google Analytics, gives you the breakdown.

The search engine category will show you which search engine got you much traffic, Google, Bing, Yahoo, Facebook, etc.

The referral source breakdown will show you which websites you need to work with the most. You will need exclusive Facebook content to make your Facebook audience feel special if your main referral source is Facebook.

If your main referral source is an external website, you might want to consider partnering with that site (guest post exchange or something else).

How do Visitors Interact With your Content?

Google Analytics will show you how the visitors interact with the content of your website. It will also show you what % of the visitors clicked on which link on your website and many more.

You will also be able to run A/B split tests by creating content experiments in Google Analytics to know what works better to meet your goals.

By seeing the interactivity of your visitor, you can work your website content around your visitors. By seeing the above answers to the questions, you can focus on the strategies that work for your website and avoid methods that do not work.

Simply put, finish the task of estimating and focus on the essential statistics so that you can make decisions based on the data.

How do I Sign up with Google Analytics

Google Analytics is available for free, and all you require is a Gmail or Google account to sign up. The process is very simple to sign-up. Follow the complete instructions Step-by-Step below on how to create your Google Analytics account.

Step No 1: Firstly, you will need to visit Google Analytics to sign up.

It will ask you for a Google account to log in with. If you already have an account, then you should use that account to sign in. Otherwise, you will require to create a new Google account.


Step No 2: After you sign in with your Google account, you will be prompted to the screen below. From here, you can sign up with your Gmail account to Google Analytics.


Then, it will ask you to provide the name of your account. Initially, you can use this name, or you can use anything such as your business name.


Step No 3: This screen will allow you to choose between apps and web or web apps. Ensure you select ‘Web.’



After that, you will need to enter the name of your website, URL of your website, country, and time zone.


After entering this information, you need to click on the Next button. It will present you the terms and service with Google Analytics to which you will have to agree, so click on the ‘I Agree’ button.

Step 4: Now, it will present you tracking code with your Google Analytics. You need to copy this tracking code because you will have to enter it again in your WordPress website depends on the method you are using below.


We recommend leaving the Analytics Browser tab open as you might require to revisit the code after you install it on the WordPress website.

That’s it; you have signed up with a Google Analytics account. Let’s see how you can install Google Analytics in your WordPress.

How to Install Google Analytics in WordPress

There are some various ways to install Google Analytics in WordPress. We will diocese you three quick methods where the first option is the easiest and the last one is the hardest.

You should choose the one that suits your website’s requirements.

Note: You will need to use only one method on your site to avoid page views double tracking in your Google Analytics account.

Method No 1. Google Analytics for your WordPress by MonsterInsights

For WordPress, Monsterinsights is a very popular Google Analytics plugin. Used by more than 3 million websites, including PlayStation, WPPickle, Bloomberg, Zillow, and a lot more.

It is the easiest and best way to add Google Analytics to WordPress (same for all user experts and beginners).

MonsterInsights is available as both a free version and a paid premium plugin. In this article, we will use a free version of MonsterInsights.

You can also use the MonsterInsights Pro version if you need more advanced features such as Ads tracking, Author tracking, E-commerce tracking, etc. The setup process for them is the same.

Let’s get started.

First, the MonsterInsights plugin should be installed and activated. For further details, you can check out our step-by-step guide on how you can install a WordPress plugin.

Upon activation, the plugin would add a new menu item labeled ‘Insights’ to the admin menu of your WordPress. When you click on it will bring you the MonsterInsights setup wizard.


First, it will ask you to choose a category for the website (a blog, online store, or business website). Choose one, and after that, click on the ‘Save & Continue button.

Next, you should click the ‘Connect MonsterInsights’ button.


It would bring up a popup that will take you to Google accounts, where it will ask you to sign in or choose a Google account if you are already signed in.


Next, it will ask you to let MonsterInsights access your Google Analytics account.


To continue, you should click on the ‘Allow’ button.

The last step is to choose the profile you want to follow. You will need to select your website here. And after that, to continue, click on the ‘Complete Connect’ button.


Now, on this screen, MonsterInsights will install Google Analytics on the website. After that, it will ask you to choose your website’s recommended settings.


The default settings will work for most websites. You will need to add the path you are using to cloak affiliate links If you use an affiliate link plugin. It will allow you to access the affiliate links in Google Analytics.

To save your settings, you can simply click the Save and Continue button.

On the next screen, MonsterInsights will display you paid add-ons that you will be able to access if you upgrade to the PRO version. To skip this step, click on the ‘Save & Continue button.


After that, it will ask you to install the WPForms plugin, one of the best WordPress contact form plugins. If you want, you can install this plugin or simply click on ‘Skip this Step.’


Well done; Google Analytics is now successfully installed and set up on your WordPress website. Remember, sometime before showing your stats; it will take Google Analytics.


The best option about MonsterInsights is that you will be able to view your Google Analytics reports inside the WordPress dashboard. You can simply visit the Insights » Reports page to check out your analytics data’s quick overview.


It also comes with a popular posts add-on showing you the best performing content to increase your traffic and page views.


You can use it to add inline popular blog posts links to boost engagement automatically:


If you use an online store, then it will also be able to add your top-performing products at the end of every post to boost sales automatically:


Note: by Yoast, MonsterInsights was formerly known as Google Analytics for WordPress.

Method No 2. Insert Headers and Footers Plugin

This method is not as good as MonsterInsights because you will not be able to do advanced tracking configuration. You will not be able to view Google Analytics data in your WordPress dashboard.

First, you will have to copy your Google Analytics tracking code copied earlier in Step 4 while signing up for a Google Analytics account.


Next, you need to install and activate the Insert Headers and Footers plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Settings » Insert Headers and Footers page. Here you need to paste the Google Analytics tracking code that you copied earlier into the ‘Scripts in headers’ section.


Don’t forget to click on the save changes button to store your settings.

That’s all; you have successfully installed Google Analytics on your site.

Method No 3. Install Google Analytics in WordPress Theme

This method is for advanced users who are familiar with the code. It is somewhat unreliable because your code will disappear if you switch or update the theme. We rarely recommend using this method.

If this is your first time adding code to your WordPress files, you should check out our guide on copy-paste code snippets in WordPress.

First, you will need to copy your Google Analytics tracking code that you copied earlier in Step 4 when signing up for a Google Analytics account.


Now there are two common ways to add this code to your WordPress theme files. You can choose either one of them (not both).

Add code in header.php file

Simply edit the header.php file in your WordPress theme and paste the Google Analytics tracking code you copied earlier, right after the <body> tag.

Don’t forget to save your changes and upload the file back to your server.

Add via Functions File

You will also be able to add Google Analytics tracking code to the WordPress functions file. It will then add the tracking code to each page on the WordPress website automatically.

You need to add this code to functions.php file of your theme.









add_action(‘wp_head’, ‘wpb_add_googleanalytics’);

function wpb_add_googleanalytics() { ?>


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


<?php } ?>

Viewing Reports on Google Analytics Website

Google Analytics can show you a treasure of data collected from your stats. You will be able to see this data by visiting your Google Analytics dashboard.


You will see the built-in Google Analytics reports in the left column. Each section is divided into different tabs, and clicking on a tab will expand it to show more options.

  • Real-time, this report will show you a real-time view of your traffic.
  • The audience tab will show reports to help you understand your users.
  • Acquisition reports explore where your users came from.
  • Behavior reports summarize what your users do after they arrive on your site.
  • Conversion reports show how well you’re doing against your goals.

Making the Most out of Google Analytics

Google Analytics is a highly significant tool with tons of amazing features. Some of them are pretty clear and easy to use; others need some extra setup.

Here are some resources that will help you get the most out of Google Analytics reports.

  • Track outbound links in WordPress
  • Track WooCommerce clients in Google Analytics
  • Track user engagement in WordPress with Google Analytics
  • WordPress Conversion Tracking Made Simple – A Step-by-step guide

Google Analytics is working very well with Google Search Console (previously Google Webmaster Tools).

It lets you see how your website is performing in search results. Check out our complete Google Search Console Guide to learn how to use it to enhance your website.

If you want to improve your Website Search Engine Optimization “SEO” rankings and gain more website traffic, we recommend using the AIO SEO plugin for WordPress.

I hope this tutorial helped you learn to install Google Analytics in WordPress. If this article was helpful, please comment and share it with your family and friends or ask any questions in the comment box.

Thanks for Reading

Read More:

How Much Does a Membership Website Cost to Start?

How to Change the Admin Color Scheme on WordPress?

How to Share WordPress Blog Posts Automatically to Twitter?

How do I post to Facebook from WordPress Blog Automatically?

How to Easily Change the Author of a post on a WordPress website?

How to Start a WordPress Blog –Easy and Quick Guide to Create a Blog in 2021?

Ultimate Guide: How to Create a WordPress Website – Step-by-Step (Free) Guide for Beginners?


About the author


Leave a Comment