Understanding the behavior or interaction of users with the website is extremely important. The best way to know the interaction of people who access the website is to track access data, also known as traffic. This data you will get through a completely FREE tool is Google Analytics.

This article will mention a little about the importance of Google Analytics tool for the success of a website. And the most important part is that it will guide each step in detail so you can install Google Analytics into WordPress website easily.

Benefits of Google Analytics

Google Analytics provides you with extremely important data to help you optimize the website to achieve the best results. Including:

Who visit your website?

This data set tells you the important information about visitors such as the living area, age and gender.

You also know what equipment they use (Mobile, PC, Tablet), what operating systems (Windows, iOS, Android, …), Browser (Chrome, IE, …), screen resolution, etc …

This information is very important, it helps you optimize and plan to write content suitable for the reader. For example, the main object is female and the age of 20, then you will choose the content as well as use the language that is suitable for this object instead of the reader is male and 50 years old.

If most readers access by Smart Phone, it is clear that you need to focus on optimizing page load speed and design to show the best website on this type of device.

What do users do on your website?

You can know which pages they see on the website, how long they stay, and the Bounce Rate escape rate (the user ratio is only one page and exit the website). From there you will optimize Bounce Rate.

You will see which page or content that people see the most.

What time does the user often access?

You will know when the day of the day there are the most visited people, from which you plan or post new posts at the right time. Or you can set the post automatically.

You can also see the number of people who are accessing in real time.

Where does the user from your website come from?

Google Analytics gives you how many percent of users on the website through channels such as Google (natural traffic), Facebook, YouTube, or direct source (type the website address in the browser and then Enter), etc.

Knowing the access source will help you promote or adjust the traffic channels that match your intentions. For example, your strategy is to push the Facebook traffic channel, looking at this data you will evaluate it.

There are many other benefits that Google Analytics brings, the framework of this article will not go too deep into it, Google Analytics and its application is a very wide topic.

How to Signup with Google Analytics

Google Analytics is available for free and all you need is a Google or Gmail account to sign up. The signup process is quite simple, follow the step-by-step instructions below to create your Google Analytics account.

Step 1: First you need to visit the Google Analytics website to sign up. When you’re on the website, simply click the ‘Get started today’ button.

Next, you will be asked to login with your Google account. If you already have a Google or Gmail account, then you can use that to sign in. Otherwise, you can go ahead and create a Google account for yourself.

Step 2: Once you sign in with your Gmail account, you will be prompted to a welcome screen like the one below.

This is where you will signup for Google analytics with your Gmail account. Go ahead and click the ‘Start measuring’ button.

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.

Google Analytics will also show multiple account data sharing settings. These settings give you control over sharing your Google Analytics data. You can keep the default settings and move on to the next step.

Step 3: On the next screen, you will need to create a Google Analytics property.

Google introduced a new version of Analytics called Google Analytics 4 or GA4. It’s the latest version that tracks your website and mobile apps in the same account. Plus, you get new features, metrics, and a different interface for your reports.

Important Note: If you already have a Universal Analytics account, then it’s critical to start tracking data in Google Analytics 4 (GA4) as well. That’s because Google will sunset Universal Analytics on July 1, 2023. After the sunset date, Universal Analytics will not receive any data and will eventually stop working.

Setting up a Google Analytics 4 property after the sunset date will mean starting from scratch. However, you can start sending data into GA4 today while still using Universal Analytics. This way, you’ll have historical data in Google Analytics 4 for comparison and analysis when Universal Analytics closes.

To start, go ahead and enter a property name, select your reporting time zone, and currency. Then click the ‘Next’ button.

On the next screen, you’ll need to select an ‘Industry category’ from the dropdown menu for your website and choose a ‘Business size’ from the given options.

Next, you’ll need to scroll down and select how you intend to use Google Analytics with your business, like measure engagement, optimize advertising cost, increase conversions, and more.

You can choose multiple options or all of the given options that meet your needs. When you’re done, simply click the ‘Create’ button.

Once you click on the Create button, a popup window will open with Google Analytics terms of service agreement.

Simply click the checkbox for ‘I also accept the Data Processing Terms as required by GDPR’ and then click the ‘I Accept’ button.

Next, you’ll see a popup with options on which communication emails you’d like to receive from Google Analytics.

Simply click the checkbox for the updates you want to receive and then click the ‘Save’ button.

Step 4: Now you will be presented with your Google Analytics Webs stream options.

Since we’re setting up Google Analytics for a WordPress site, go ahead and select the ‘Web’ as the platform.

After that, you’ll need to enter your website URL and Stream name.

By default, Google Analytics will have an Enhanced measurement option enabled. This allows you to track page views, scrolls, outbound clicks, file downloads, and more in Google Analytics.

Next, you can click the ‘Create stream’ button.

You can now see your Stream URL, name, and Measurement ID.

It will also show different enhanced measurements that it will record.

Google Analytics will also show different ways to add Google Analytics code to your WordPress website under the ‘Tagging Instructions’ section.

If you click the ‘Global site tag (gtag.js) option, you’ll see the Google Analytics tracking code.

You can copy this tracking code because you will need to enter it in your WordPress site depending on the method you use below. You can also simply leave this browser tab open and switch back to copy the code when needed.

We suggest leaving the Analytics browser tab open as you may need to revisit it once you have installed the code on your WordPress site.

Now that you have set up a Google Analytics account, let’s take a look at how to install Google Analytics in WordPress.

How to Install Google Analytics in WordPress

Google Analytics for WordPress by MonsterInsights

MonsterInsights is the most popular Google Analytics plugin for WordPress. Over 3 million websites use it including the likes of Bloomberg, PlayStation, Zillow, WPBeginner, and more.

It is the easiest and by far the best way to add Google Analytics to WordPress (for all users beginners and experts alike). Plus, it offers a Dual Tracking feature that lets you add Universal Analytics and Google Analytics 4 to your WordPress website without editing code.

MonsterInsights is available as both, a paid premium plugin, and a free version. In this tutorial, we will be using the MonsterInsights free version.

You can use the MonsterInsights Pro version if you want more advanced features like eCommerce tracking, Ads tracking, Author tracking, etc. The process of setting them up is the same.

Let’s get started.

The first thing you need to do is install and activate the MonsterInsights plugin. Upon activation, the plugin will add a new menu item labeled ‘Insights’ to your WordPress admin menu and you’ll see a welcome screen. Go ahead and click the ‘Launch the Wizard’ button.

Clicking on it will open the MonsterInsights setup wizard.

First, you will be asked to choose a category for your website (a business website, blog, or online store). Select one and then click on the ‘Save and Continue’ button.

Next, you need to connect MonsterInsights with your WordPress website.

Simply click on the ‘Connect MonsterInsights’ button.

This will take you to Google accounts where you will be asked to sign in or select a Google account if you are already signed in.

Go ahead and choose your Google account or enter your email to sign in.

Next, you will be asked to allow MonsterInsights to access your Google Analytics account.

Click on the ‘Allow’ button to continue.

The next step to completing the connection is to select the profile you want to track.

You need to select your website here and then click on the ‘Complete Connection’ button to continue.

After that, simply click on the ‘Complete Connection’ button to continue. MonsterInsights will now install Google Analytics on your website.

Next, you will be asked to select the recommended settings for your website.

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.

MonsterInsights will also ask who can see the reports. You can choose different WordPress user roles. Once you’re done, click on the ‘Save and Continue’ button to save your settings.

Next, MonsterInsights will show you a list of website tracking features you would like to enable.

You can scroll down and click on the ‘Continue’ button or the ‘Skip for Now’ option.

On the next screen, MonsterInsights will show that you’ve successfully setup Google Analytics tracking.

You can see that Google Analytics is connected, tracking code is installed, and data is now being collected.

Next, you can scroll down and see a field to enter your license key.

Go ahead and click the ‘Complete Setup without Upgrading’ option for now.

You’ve successfully added Google Analytics to your WordPress website.

Next, you’ll need to create a Measure Protocol API Secret. This will allow MonsterInsights to track events like eCommerce purchases, form conversions, and more.

To start, you can login to your Google Analytics account. Then head over to the ‘Admin’ settings page and click on the ‘Data Streams’ option.

Next, you’ll see your Data Streams.

Simply select the data stream you connected with MonsterInsights.

On the next screen, scroll down to the ‘Advanced Settings’ section.

After that, click on the ‘Measure Protocol API Secrets’ option.

You’ll now see a new window slide in with your Measurement Protocol API Secrets. Initially, this page will be empty, and you won’t have any API secrets.

Go ahead and click the ‘Create’ button.

Next, you’ll need to enter a nickname for your API secret.

Once you’ve done that, simply click the ‘Create’ button.

Your API secret will now be created.

Go ahead and copy the API secret that’s under the ‘Secret Value’ field.

Next, you’ll need to enter the Secret Value in MonsterInsights.

You can do that by going to Insights » Settings from your WordPress admin panel and then clicking the ‘General’ tab.

Then head over to the ‘Google Authentication’ section.

Simply enter the Secret Value under the ‘Measurement Protocol API Secret’ field.

You’ve successfully set up the Measurement Protocol API Secret.

Now, let’s see how to use dual tracking in MonsterInsights if you have a Universal Analytics account.

How to Set Up Dual Tracking When Using Universal Analytics

If you already have a Universal Analytics account, then MonsterInsights makes it super easy to track both Universal Analytics and Google Analytics 4 through its Dual Tracking feature. The best part is that you don’t have to edit any code.

Just note that Universal Analytics will sunset on July 1, 2023, and you won’t be able to track your website data after the sunset date. We highly recommend that you set up a Google Analytics 4 property today and start sending data to GA4.

To set up dual tracking, you can start by going to Insights » Settings from your WordPress dashboard and then click the ‘General’ tab.

After that, scroll down to the ‘Google Authentication’ section.

Under the ‘Dual Tracking Profile’ field, you can enter the Univeral Analytics (UA) code.

You can find the Universal Analytics code in Google Analytics by going to the ‘Admin’ settings page.

After that, click on ‘Property Settings’ under the Property column.

You’ll see the ‘Tracking Id’ in the following format: UA-123456789-1.

You’re now successfully tracking Universal Analytics with Google Analytics 4 on your WordPress site. Remember, it will take Google Analytics some time before showing your stats.

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

It also comes with a Popular Posts addon that allows you to show your top-performing content to boost your traffic and pageviews.

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

If you’re using an online store, then it can also automatically add your top-performing products at the end of each blog post to boost sales.


Hope you have successfully installed Google Analytics for your website. If any problems, please leave a comment and everyone will help.

Thank you for reading and have a good day!

Reference: wpbeginner.com, “How to Install Google Analytics in WordPress”, April 6, 2022.

Leave A Comment