If you are planning to add Google Analytics to WordPress website, to help you understand how your audience interacts with your website, as well as how to improve their experience, then continue reading.
In this article we shall help you to take advantage of your website traffic stats provided by google analytics which is accessible on Google Analytics for FREE.
Before we look at how to install google analytics, lets look at what it is. In simple terms, Google analytics is a platform that monitors and analyzes your website’s traffic and provides you with key data to help you understand and improve it.
This is how it works, it requires you to add a piece of JavaScript code to your page (covered later) that allows Google to track the website activities, and then produces a detailed stats about them in your Google Analytics account.
That means that you will need to open an account first if you haven’t with google analytics.
We shall demonstrates the importance of adding Google Analytics and how it can be easily installed on your WordPress website (step by step).
Adding Google Analytics in WordPress
Google Analytics can be installed in WordPress through different methods. Two of these methods are represented here; a simple method and a technical one.
You can choose either of them depending on your requirements.
Note: Only one of these methods should be used; otherwise, the page view would be double-tracked in your Google Analytics account.
Method 1. Google Analytics for WordPress by MonsterInsights
The most popular Google Analytics plugin for WordPress is MonsterInsights, which is used by more than 1million websites, such as Bloomberg, PlayStation, Zillow, and more.
MonsterInsights is currently the best and the most straightforward way of adding Google Analytics to WordPress (for all users beginners and experts alike). For more advanced options such as E-commerce tracking, Ads tracking, Author tracking. The setup process is the same.
1) First, the MonsterInsights plugin should be installed and activated.
After activating the plugin, a new menu item labelled “Insights” will be added to the WordPress admin menu. The MonsterInishgt setup wizard starts by clicking on this menu.
First, it asks the category of your website (a business website, blog, or online store). Select one of the available options, then click “Save and Continue.”
2) Second, click on “Connect MonsterInsights.”
A popup appears that asks you to sign in to your Google account or choose one of the accounts if you have signed in before.
3) In the next step, you have to allow MonsterInsights to access your Google Analytics account.
Click on ‘Allow’ and continue.
4) Finally, you have to select the profile you want to track. Here, you should select your website and click “Complete Connection” and continue.
Now Google Analytics is installed on your website. Next, you should select the recommended settings for your website.
The default settings can be applied to most websites. If you use an affiliate link plugin, you should add the path you use to cloak affiliate links. Doing so, you can track your affiliate links in Google Analytics.
Next, you can only click on the ‘Save and Continue’ to skip this step.
You are then asked if you wish to install the best WordPress contact form plugin, WPForms plugin. You can install it or click on ‘Skip this Step.’
Finished! Google Analytics is installed on your WordPress site. It should be noted that it takes time for GoogleAnalytic to show your stats.
The best point of MonsterInsights is that it shows the Google Analytics reports inside the WordPress dashboard. Visit Insights » Reports page to check out a quick overview of your analytics data.
Note: MonsterInsights was initially known as Google Analytics for WordPress by Yoast.
Method 2. Add Google Analytics to WordPress Theme
The advanced users who can employ the code can use this method. However, it is, to some extent, unreliable because if the theme is switched or updated, your code will disappear. It is not recommended to use this method.
If you want to add code to your WordPress files for the first time, use instructions on how the code snippets should be copy-pasted in WordPress.
When signing up for Google Analytics account, you should first copy the Google Analytics tracking code copied earlier in Step 4.
This code can be added to the WordPress theme files via two common methods. One of them should be selected (not both).
1. Add code in header.php file
In your WordPress theme, edit the header.php file and paste the Google Analytics tracking code copied earlier after the <body> tag. Remember that you should save your changes and upload the file back to your server.
2. Add via Functions File
Also, the Google Analytics tracking code can be added to the WordPress functions file. Then, the tracking code will be automatically added to every page on your WordPress site.
This code should be added to the functions.php file of your theme.
Google Analytics can show you a treasure of data collected from your stats. This data can be viewed by visiting your Google Analytics dashboard.
The left column represents the built-in Google Analytics reports. All sections are divided into different tabs. Each tab is expanded by clicking on it and shows more options.
Real-time represents a real-time view of your traffic.
Audience tab represents reports that can help you understand your users.
Acquisition reports represent the origin of the users.
Behaviour reports show the actions taken by the users after arriving on your site.
Conversion reports demonstrate how you are doing to achieve your goals.
Final Thoughts – Making the Most out of Google Analytics
Google Analytics has a lot of outstanding features that make it an incredible tool. Some features are almost clear and simple to use, while others need some additional setup.
Google Search Console (previously Google Webmaster Tools) is the best to be used with Google Analytics. It shows how your website is doing in search results. To learn how to grow your website, see our complete Google Search Console guide.
That’s it!
You’ve just learned how to add Google Analytics to WordPress without a plugin. But if you’re looking for a simpler method, then using plugins for Google Analytics WordPress can help out. MonsterInsights makes it super simple to connect your site with Analytics.
And if you’re still wondering whether it’s a good idea to install Analytics without a plugin, you should do your own research but I recommend to use plugin to do that.
After installing Google Analytics, you might also want to stop Google Analytics from tracking logged in WordPress users which can be done through settings.
Hope this guide was useful for you and feel free to leave your opinion in comments below.