Right after building a WordPress website, I usually proceed to install Google Analytics . This is a free tool from Google. It provides you with important statistics about the website.
Some useful information to include:
Information about the geographical location of your readers as well as information about the browser they are using. Or where they came to your website from. Direct access, from social networks or from Google Search.
How long do they stay on your site or is your bounce rate too high?
Such information helps you build a reasonable plan to optimize your website. For example, if the bounce rate is too high. You need to edit the article so that it is more attractive to readers.
For all webmasters, Google Analytics is a must-have tool for your website.
In this article, I will show you how to install Google Analytics
Contents
How to sign up for Google Analytics
1. You do not have an account in Google Analytics
First, you go to https://analytics.google.com/analytics/web/ . You use your Gmail account to log in.
After logging in, you will see the registration screen below. Click the Sign up button to continue.
On the next screen, enter the website information you want to install Google Analytics on. Click Get tracking ID. The Googles Term screen appears. Click Accept.
You should now see the tracking code. You will add this code to your WordPress website as shown below
2. You already have an account in Google Analytics
To add a website to Google Analytics, click on Admin. And choose Create new property if you want to add a website to an existing account. Or create a new account depending on your organization.
Next you will enter the website information and get the tracking Id code as in the above step.
How to Install Google Analytics for WordPress
There are many ways to install Google Analytics for WordPress. I show you in turn from the simplest to the most complex.
You can choose a way that suits your preferences.
1. Using the Google Analytics for WordPress plugin by MonsterInsights
MonsterInsights is the most popular Google Analytics plugin for WordPress. The plugin boasts more than 1 million websites in use.
This is also the simplest and fastest way to install Google Analytics for WordPress. The plugin has 2 free versions and a Pro version .
You can use Pro version if you want to add advanced features like Ecommerce tracking, Ads tracking, Author tracking.
Below I will guide you to install and use the free version.
First you need to install and activate the plugin , Once the plugin is activated, you will see a new item called ‘ Insights ‘ in the sidebar of WordPress Admin.
Go to Insights -> Settings to configure the plugin.
On this screen, you need to click on the ‘ Authenticate with your Google Account ‘ button to connect your website to Google Analytics.
A popup appears allowing you to authenticate your Google account.
Click on the ‘ Next button to continue.
Now you need to click on the ‘ Click to get Google Code ‘ button.
This will open another popup with the message ” MonsterInsights would like to access to your Google Analytics data .’
Click the ‘ Allow ‘ button to continue
The popup window will display a line of code for you to copy.
Next, you need to paste the line of code you copied above and click on the ‘ Next ‘ button to continue
The last step is to select the profile ie the website you want to track. Then click the Next button to continue
So you have successfully installed Google Analytics for your WordPress website.
The advantage of this plugin is that you can view Google Analytics reports right in the WordPress Admin. Simply go to Insights – > Reports to view your data reports.
You can go to the Tracking tab to customize your tracking settings based on your preferences.
This method has the disadvantage that you cannot view Google Analytics reports in WordPress Admin. Plus, you don’t have advanced trakcing configuration either.
First, you install the Insert Headers and Footers plugin . Next, go to Settings -> Insert Headers and Footers , paste the code you got in the step above into the Header section
3. Install Google Analytics in WordPress Theme
This way is for someone who knows how to code a bit.
You paste the tracking code into the theme’s header.php file. Remember to create a child theme before editing to make sure the code is not lost when you update the theme to a new version.
Here’s how to do it:
You go to Appearance -> Editor . Select the file header.php and paste the code
At this point, you have completed the installation of Google Analytics for your website. You access Google Analytics and click Reporting to see your website statistics. It takes about 12-24 hours for Google to start providing the site statistics you need.
Epilogue
Installing Google Analytics is not too complicated. You only need a few minutes to install.
If you have problems with the installation of Google Analytics, please leave a comment below.
Read more
How to create xml sitemap and submit to Google Search Console
2-factor security settings for WordPress
How to Add Google Search in WordPress
Instructions to install Google AMP for WordPress
Detailed instructions on how to monitor a WordPress site

