How to easily install Google Analytics Global Site Tag (gtag.js) on WordPress with MonsterInsights
Are you looking to add Google Analytics Global Site Tag on your website the easy way. If yes, then you have come to the right place.
Google Analytics is a tool by Google that helps you track website traffic and gives to detailed insights about the visitors.
For Google Analytics to work you need to add a tracking code in your WordPress website’s theme header or header.php
.
Now, if you are starting out and have no prior technical experience then adding the Google Analytics tracking code or Global site tag can be a bit tricky.
And that is why is it suggested that you use a plugin like MonsterInsights rather than installing it manually.
Why you should use MonsterInsights for Google Analytics
- Ease of Use– As mentioned above, if you are new to the online world then editing theme files and adding Global site tag can be a little overwhelming. And with MonsterInsights you can install Google Analytics easily.
- Google Analytics Stops tracking– Often while browsing Facebook groups, I have seen a question being asked very frequently and that is ” Google Analytics is not tracking traffic anymore. Why?”. And the answer to this question is very simple and that is the Google Analytics tracking code has been deleted. This can happen in a few scenarios and these are
- You recently changed your WordPress theme and forgot to add the code.
- Recently your theme was updated and the code was wiped our as it was installed in the parent theme and not the child theme.
Keeping this is mind when you add Google Analytics using MonsterInsights then you will not have to worry about losing the code. Be it you are changing the theme or updating it.
It is important to keep in mind that we recommended if you make any changes to your site you make it on a child theme and not parent theme as changes can be reversed on updation.
- Access to powerful features- When you install Google Analytics with a plugin, you will have to configure it properly to get the most out it and to check insights you will have to log in to Google Analytics every time. But with MonsterInsights, you will see all the reports inside your WordPress dashboard
And on top of that you get access to features like affiliate link tracking, file download tracking, custom dimensions and more.
Now, in this tutorial we will be covering the following topics
- What is MonsterInsights
- Create Google Analytics account
- Install MonsterInsights
- Adding Google Analytics Global site tag using MonsterInsights
Before we start the tutorial, it is important to know if you have already installed Google Analytics code on your site before and you want to use MonsterInsights then you will have to remove the tracking code from your theme first and then follow this tutorial.
Because if adding the code twice then you won’t get accurate reports.
Having said that, lets start the tutorial.
What is MonsterInsights
MonsterInsights is the most popular Google Analytics plugin using which you can install Google Analytics easily on WordPress site and at the same time get access to detailed insights inside your dashboard.
This means you don’t have to leave your WordPress dashboard to see the detailed reports as everything is available inside your dashboard with just a click of a button.
MonsterInsights was previously known as Google Analytics for WordPress by Yoast. In 2016, it was acquired by Syed Balkhi and its name was changed to MonsterInsights.
From then on MonsterInsights has received massive changes making it a very powerful plugin which is popular amongst users.
As we are discussing the popularity of the plugin, it is important to know MonsterInsights has over 2 million active installations and 1900+ five star reviews.
MonsterInsights is packed with features and is available in 2 versions
- Lite
- Premium
MonsterInsights Lite is a free plugin and this means anyone can download and install it from WordPress plugin repository.
And it includes features like
- Easy Google Analytics setup
- Universal tracking
- Access to insights in WordPress dashboard
- Affiliate link tracking
- File Download tracking
- Enhanced link attribution
- Engagement and demographic reports
And more. See all the features of MonsterInsights Lite.
On the other hand, MonsterInsights premium plan starts at $99.50/ year (which is a Discounted using our SPECIAL LINK) and includes features such as
- Everything in Lite
- Real time reports
- Woo-Commerce
- EU Compliant
- Lifter LMS
- Search Console reports
- Publisher reports
- Custom Dimensions
- Form Conversion tracking
- MemberPress
And more. See all the MonsterInsights feature
Before we move forward, it is important to know if you are a WordPress.com user and want to use Google Analytics by MonsterInsights then let me tell you unlike WordPress.org, WordPress.com does not allow you to install plugins in the lower tier plans.
However, if you have a WordPress.com Business plan then you can use MonsterInsights as it is compatible with the platform.
Now that you are familiar with MonsterInsights, its time we
Create an account on Google Analytics
To add Google Global site tag to WordPress using MonsterInsights, the first step is to create a Google Analytics account.
And for that you need to visit Google Marketing Platform.
Here you will find 2 options
- Start for free
- Sign in to Analytics
Both these options will take you to the same page where you will be asked to either sign in using an existing Google Account or create a new one.
If you already have a Google account then all you have to do is add your email in the space provided and click Next and enter your password.
In case you don’t have a Google account then you need to create a new one and for that you need to click Create Account.
Doing this will take you to a new page where you will have to provide basic information about yourself and this process will only take a few minutes.
Having said that,
Once you have signed in to Google Analytics, it will take you to the welcome page where you will have to click Set up free
On clicking this, it will take you to a new page where you are required to provide basic account details which is the name
After entering the account name, the next step is to click the Next button at the bottom of the page.
When you click Next, it will ask you what you want to measure using Google Analytics and you will get 3 options to choose from
- Web
- Apps
- Apps and Web
Here you need to select Web as you will be tracking traffic for a website. Click Next in the bottom of the page.
And it will take you to the Property Set up where you re required to provide details such as
- Website Name
- URL
- Industry Category
- Reporting Time
Enter all the details as shown in the screenshot above and click Create.
On doing so a popup will appear that will show you the Google Analytics Terms of Service Agreement.
Here you all you have to do is check if the country/ region mentioned is correct and in case it is not then change it to your country and accept.
Once you accept the terms, it will take you to the Google Analytics dashboard where the first thing you will see is an email communication popup.
Select the options that you would like to receive the emails about and click Save.
On clicking Save, it will show you the Tracking ID and Google Analytics Global Site tag.
Now the next step is to go to your WordPress dashboard and
Install Google Analytics by MonsterInsights
Before we move forward, it is important to know you can easily add Google Analytics gtag.js to WordPress using MonsterInsights Lite and get access to basic reports inside the dashboard.
However, for advanced features you will have to use premium version and using our SPECIAL LINK you can get a 50% Discount.
As MonsterInsights Lite is available for free, you can install it from the built-in plugin repository inside your Wordress dashboard.
And for that the first step is to log in to WordPress admin and then head over to Plugins and click Add New.
When you click Add New, it will show you all the available WordPress plugins in the repository. And the next step is to search for MonsterInsights.
On doing so, it will show you the plugin and the next step is to click Install Now and activate it.
Once you install and activate MonsterInsights plugin, it will take you to the welcome page and there you need to click Launch Wizard.
When you click Launch Wizard, it will take you to the first phase of the MonsterInsights set up which is Selecting a category that best fits your business.
As Blogging Unplugged is a blog, we selected Published (Blog) and after picking click Save and Continue.
On doing this, it will take you to the next phase where you need to connect MonsterInsights to Google Analytics and for that you need to click Connect MonsterInsights.
When you click Connect MonsterInsights, it will take you to a new page where you need to select the account that you have used to sign up on Google Analytics.
After selecting a Google account, it will ask for your permission to access the information and here you need to click Allow.
On clicking Allow, it will take you back to the MonsterInsights set up and here you are required to pick a profile that you want to track and connect with MonsterInsights.
Once you have selected a profile, click Complete Connection and it will take you to the next phase which is the Recommended Settings.
Here you will notice, Events Tracking and Enhanced Link Attribution is enabled by default. In case it is not then I will recommend turning both these option On.
Also, it is important to know MonsterInsights by default tracks downloading of common file formats. In case you are offering file downloads in some other formats then you can add the extension to the list.
Once you are done till here, you need to scroll down a bit where you will find the Affiliate Link Tracking setting.
If you are an affiliate marketer then you must be familiar with the fact that affiliate links are most long and unbranded.
And if you want to track these links using MonsterInsights then you need to cloak it first.
In this setting, you need to add custom affiliate link paths for MonsterInsights to track these links. By default 3 of the most commonly used ones are defined by default to track.
And in case you have specified a different path then you can it by clicking Add Another Link Path.
Moving forward, the next settings on the list are
- Who can see reports– Using this setting you can add or remove the user roles that will be able to access MonsterInsights reports in the WordPress dashboard.
- Install automatic updates– If you want to install latest updates and bug fixes as soon as they are released then you can enable this setting. Personally I avoid enabling any such settings as updates can at times break your site.
- Help us improve– If you enable this setting then MonsterInsights will collect data from your WordPress website or blog such as which plugins and themes you are using. Which settings you use the most and this will help them further improve the product.
Having said that,
Once you are done till here, click Save and Continue and it will show you a list of recommended addons that you can install.
These addons will unlock premium features and if you use our SPECIAL LINK you will get a 50% discount.
If you want to skip this then you can click Save and Continue at the bottom.
On clicking this, it will show you a message letting you know that MonsterInsights is all set up and ready to use.
Before we move forward, it is important to keep in mind that Google Analytics won’t send data immediately to WordPress and it can take up to 24 hours for reports to show.
Also, in case you are using a cache plugin then it is recommended that you clear it after the setup is over.
If you are new to WordPress and are looking for a cache plugin then I will recommend using WP Rocket. It is the one that we use to speed up all our sites.
Having said that,
The last thing you have to do here is to click Finish Setup and Exit Wizard and it will take you back to your WordPress dashboard.
And thats it you have successfully installed Google Analytics Global site tag on your WordPress site using MonsterInsights.
View reports in WordPress dashboard
As mentioned before, with MonsterInsights Lite you get access to basic reports and to see these all you have to do is navigate to Insights in your WordPress dashboard and click Reports.
Doing this will directly take you to the basic reports which are under the Overview Tab.
In these reports your will come across various terms that you may or may not be familiar with. Below we have briefly described some of them.
- Sessions- A session is defined as a combination of page views and action that takes place on your website in a single visit by a user. A session can contain multiple page views, social interactions, transactions and more.
- Pageviews- As the name suggests, pageviews is the number of views that a particular page on your website gets. If you want to see pageviews all you have to do is click the tab and it show you the numbers.
- Average session duration- Average session duration is the time that users spend on your site and it is calculated by dividing total session duration by number of sessions
For example, if on a day your site gets
Total session duration= 100 mins
Number of sessions= 20
The average sessions duration will be 5 minutes.
- Bounce rate- Bounce rate is the percentage of sessions that only have a single page view. This is a very useful metric as it gives you a clear idea, if visitors are browsing your site or not.
Other reports that you will be able to see in your dashboard are
- New vs Returning visitors
- Top 10 countries
- Top 10 Referals
- Top posts and pages
in case you want to get access to Publisher reports, Real-time reports, Search Console or any other report then you will have to upgrade to premium.
Having said that,
I hope you have found this tutorial helpful and are able to install Google Analytics Global site tag on your WordPress site easily. In case you have any queries then feel free to reach out via comment section.
Also, don’t forget to share this article with your friends on social media. Below are some of our popular articles that you might like to read next
- How to create a Pinterest Business account
- How to hide pins in WordPress
- How to add Pinterest save button to images in WordPress
- How to install Elementor Pro easily
- Essential settings after installing WordPress
- MonsterInsights Summer Savings Sale
To get regular updates from us join our Facebook group, subscribe to the blog, and follow us on various social media platforms. In case you are looking to check the tools we have used to create this site then see the Recommended Blogging tools section and for exclusive deals visit our WordPress Deals and Discounts.