How to Install Google Analytics in WordPress
Do you want to know How to Install Google Analytics in WordPress?
Google Analytics helps you know what the audience is looking for and what attracts them more through your traffic stats.
This tutorial will explain :
1. Google Analytics and its importance.
2. How to sign up in google analytics.
3. Ways to Install Google Analytics. ( different methods )
4. How to View Reports on Google Analytics Website.
Google Analytics and its importance
Google Analytics – It is a web analytics service offered by Google to track and report web traffic on your site. It helps you in the following ways.
1. It helps you make data-based decisions by displaying the statics.
2. It can tell the geographical location of your audience and which browser did it use to visit your site.
3. It tracks where the users are going on your website, how long they stay, and the bounce rate.
4. It can find the most popular articles on your site, the articles that are not performing well, and the type of content your users are looking for.
5. It analyzes where the users come from, such as Direct Links, Search Engines, or Referral links from another site with the percentage of each.
6. It shows which search engine got the most traffic on your site, such as Google, Bing, Yahoo, etc.
Here, we have listed how google analytics can help, but it provides much more than this.
With the statics and data provided by google analytics, you can work on your content to perform best to gain more traffic to your site, engage users and lessen your bounce rate.
How to Signup with Google Analytics
Google Analytics is available for free. To sign up, you will need your google account only. Follow the instructions step by step to create your Google Analytics account.
Step 1: Visit the Google Analytics site and sign up with your Google account.
Step 2: Then, enter an account name. Then tick the check box of google terms and services.
Step 3: After that, you have to choose one- a web, apps, or apps and web. Click on ‘Web.’
Step 4: Next, you have to enter your website name, URL, country, and time zone and click on the next option.
Step 5: After creating a google analytics account, it will provide you with a Google Analytics tracking code. You can copy and save the tracking code because you will need it later.
After setting up a Google Analytics account, let’s move on to our next step, to install Google Analytics in WordPress.
Installing Google Analytics in WordPress
You can set up Google Analytics in WordPress in different ways.
We are sharing three methods. You can select any one of them.
Method 1. Google Analytics for WordPress by MonsterInsights
About the plugin
The best WordPress Analytics plugin trusted by over 3 million professionals to expand their business confidently.
It is the simplest and easiest method to use. It makes it very easy to use Google Analytics to show details about your visitors.
This plugin is available in lite and pro versions. The MonsterInsights Lite version is free to use. It will display your most important pages inside your WordPress dashboard. The MonsterInsights Pro version includes premium integrations and advanced features like custom dimensions, WooCommerce tracking, email summaries, PDF exports, and more.
We are using the MonsterInsights Lite, the free version, here. You can use anyone you want.
Install & Activate the Plugin
To install and activate the free version of the plugin from your dashboard,
Go to plugins >>Add New >> search MonsterInsights Lite >> Install >>Activate.
setting up the plugin
After activation, it will add up a new option to your WordPress admin menu named ‘Insights.’
You will bring it to the MonsterInsights setup wizard when you click on it.
Now, select a category for your website (a business website, publisher blog, or an eCommerce ) and next click the ‘Save and Continue’ option to move ahead.
Then, click the ‘Connect MonsterInsights’ option.
After this, select the Google accounts you used to sign in to your google analytical account.
Then, click the ‘Allow’ button to allow MonsterInsights to access your Google Analytics account to continue.
Next, you must select the profile( your website) you want to track and click the ‘Complete Connection’ tab.
Now, the plugin will install Google Analytics on your website. After installation, you have to enter the details in the recommended settings.
Generally, the default settings work well for most websites.
Note- If you use an affiliate link plugin on your site, add the path you use to cloak affiliate links. It will help you to track your affiliate links in Google Analytics.
Now, Click the Save and Continue option to save your settings.
On the Next step, it will show you paid add-ons that you can access if you upgrade to PRO. Click the ‘Save and Continue’ tab to skip the step.
After this, it will also ask you to install the WPForms plugin, which is the best WordPress contact form plugin. Move ahead and click on the ‘Skip this Step’ tab.
It’s Done! Now you have successfully installed and set up Google Analytics on your WordPress site. It will take some time to show your stats.
Now click the Finish setup and exit wizard button.
How to view your google analytical reports with MonsterInsights
The MonsterInsights lets you view your Google Analytics reports inside your WordPress dashboard.
You have to visit the Insights » Reports page to see a quick overview of your analytics data.
Method 2. Insert Headers and Footers Plugin
Insert Headers and Footers – It is a simple plugin that allows you to insert code like Google Analytics, Facebook Pixel, custom CSS, and more to your WordPress site header and footer. You need not edit your theme files.
The plugin is not very good for google analytics as it does not provide advanced tracking options, and it does not display Analytics data in your WordPress dashboard.
To use the plugin, you have to install and activate the plugin from your dashboard,
Go to plugins >>Add New >> search MonsterInsights Lite >> Install >>Activate.
Then, copy your Google Analytics tracking code that you got earlier while signing up for your Google Analytics account.
After that, navigate to Settings » Insert Headers and Footers page.
Now, paste the Google Analytics tracking code you copied into the ‘Scripts in headers’ section.
Then, click the save changes tab to save your settings.
It’s done! Google Analytics is successfully installed on your site. Now you can track web traffic on your site.
3. Install Google Analytics in WordPress Theme
The method is for more advanced users who know to code. It is unpredictable because the code will disappear if you switch or update your theme. Therefore, less recommended.
Moving ahead, Copy your Google Analytics tracking code that you got earlier while signing up for your Google Analytics account.
There are two methods to add this code to your WordPress theme file. You have to use any one of them.
1. Add in header.php file
To add the code, edit the header.php file in your WordPress theme. Now, right after the <body> tag, paste the Google Analytics tracking code you copied earlier.
After that, save the changes and upload the file.
2. Add via Functions File
To add the tracking code to the WordPress functions file.
You have to add this code to your theme’s functions.php file.
<?php add_action('wp_head', 'wpb_add_googleanalytics'); function wpb_add_googleanalytics() { ?> // Paste your Google Analytics tracking code here <?php } ?>
Note- You have to add your tracking code to the above themes function.php file where Paste your Google Analytics tracking code here is written.
Viewing Reports on Google Analytics Website
Google Analytics is capable of showing you the data collected from your stats. You can see this data in your Google Analytics dashboard.
In the left column, It contains the in-built Google Analytics reports.
It is divided into different tabs, and clicking on a tab will display more options.
Real-time- It shows your real-time traffic view.
Audience- The reports help you understand your visitors.
Acquisition- It explores where your users came from.
Behavior- The reports summarize users’ actions on your site.
Conversion- It displays how good you’re doing against your goals.
To Conclude- We hope, this article helped you to install Google Analytics in WordPress. You have also learned what Google Analytics is, its importance, and how to sign up in google analytics.
If you like this, you may also want to read How to submit your WordPress site to Google News.