Web analytics is very important to grow your site. Whether you have an e-commerce site or an informative site, you want to understand your visitors’ behavior to deliver better results. Web analytics tool gives you data of your visitors to identify what they are doing and how much time they are spending on your site. You can use any web analytic tools to track your user activities, but we prefer Google Analytics. So, in this article, we will talk about Google Analytics and how to track user activities in your WordPress site using Google Analytics.
What is Google Analytics & Why does it Matter to Your WordPress Site?
As with other web analytics tools, Google Analytics allows you to track user activities and understand your customer’s behavior, user experience, online content, device functionality and more. It provides you with the information you need to shape the success strategy of your business and things you probably never knew about visitors on your site.
Below are some of the reasons why we prefer Google Analytics to track user activities.
It’s easy to use. The product does get regular updates, but its basic structure has remained the same for almost a decade. It is very intuitive for even newbie website owners with basic level tech skills to figure out. Once you set up your account and copy a simple piece of code on your site, Google Analytics will start collecting the data automatically.
Google Analytics has an entire section to provide you with information on how the visitors found your site. It tracks how many people land on your site after clicking on a link in search results, how many come from links shared on social media, from other sites, from paid ads, and by typing your website directly into search.
The site search reveals what potential customers are looking for after arriving on your website. With this information, you can make necessary changes or additions to your website’s navigation. This will make your site more users friendly and improve your site performance.
In Google Analytics you can build your own customized report or you can choose from many Google report templates. You can pick the dimensions and metrics you want to see and how they should be displayed.
Google Analytics helps you to keep a track of all the content that receives views and shares. With this data, you can enhance the top viewed blogs so that they appeal to the customers in a more productive manner.
With Google Analytics you can track the pages that keep people on your site or achieve conversions more than others. If some pages do particularly well at converting visitors to email subscribers or customers, Google Analytics helps you identify those as well.
It has Real-time visitor tracking. This means that you can see who is visiting your website in real-time and know how many active users are on your site right now, which pages they’re looking at, and what they are doing any time of the day.
It’s free. Google does not charge you anything for using it.
How to Install Google Analytics on your WordPress site?
The first thing you need to do to track your user activities on your WordPress site using Google Analytics is to install Google Analytics on your website. There are different ways to install Google Analytics on your WordPress site. But today we will show you the two easiest ways. One is using a plugin and another is by adding code to your theme file. But before following any of those two steps, you need to signup for Google Analytics. So, let’s move on____
Signing Up for Google Analytics:
Step: 1
To signup for Google Analytics, you need to login into your Google account first. Visit Google Analytics and log in to your Google account. If you don’t have one then create one first.
Step: 2
Now, you will be redirected to the following page. Press the ‘Start Measuring’ button here.
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.
Step: 3
And now, they will give you choice to choose between a web, apps, or apps and web. Make sure you select ‘Web’.
Then, you need to enter website name, website’s URL, country, and time zone.
Once you have added all of this information, click on the ‘Next’ button. At this point, they will show you Google Analytics terms and services, click on the ‘I Agree’ button.
Step: 4
Now you will be presented with your Google Analytics tracking code. Copy this tracking code because you will need to enter it in your WordPress site if you choose the manual method of adding Google Analytics on your site.
Finally, you signed up for your Google Analytics account. So, let’s jump into the installation methods.
1. Install Google Analytics with Plugin:
For the first method, we’ll use a plugin to add Google Analytics to your WordPress site. The best Google Analytics plugin for WordPress is MonsterInsights. MonsterInsights is the best and easiest way to add Google Analytics to WordPress for both beginners and experts. To set up analytics with MonsterInsights, follow these simple step-by-step instructions.
First, you need to install and activate the MonsterInsighter plugin. To install the MonsterInsights plugin navigate to ‘Plugins > Add New’ from your WordPress dashboard. Then click ‘Choose Now’ to find the plugin .zip file on your computer and click the ‘Install Now’ button. When you purchased your copy, you will have received a license key, verify with that license key.
Once your license is verified, scroll further down the page and click the ‘Connect MonsterInsights’ option.
This will redirect you to another page where you can authenticate your Google account. Then you’ll see a message from MonsterInsights asking for permission to access your account. To provide access, go ahead and click the ‘Allow’ button.
On the next page, you can select the website you’d like to collect data for. To complete the process, click on the ‘Complete Connection’ button and that’s it.
Now you can check Google Analytics reports directly on your WordPress dashboard. For this, you need to click on ‘Insights > Reports’ from within the WordPress admin area. You’ll then see the reports right on your screen.
And if you scroll down your page, you can view more details, including your top referrals, top posts and pages, top countries, bounce rate, and more.
2. By Adding Code on Theme File:
This method can be a little bit tricky if you are a beginner because your code will disappear if you switch or update the theme. It’s essential that you use a child theme so that your tracking code won’t be overwritten every time you update your WordPress theme. Before you make any changes, though, it’s always good practice to make a backup.
First, you will need to copy the Google Analytics tracking code that you copied earlier in Step 4 when signing up for a Google Analytics account.
Now there are two common ways to add this code in your WordPress theme files. You can choose either one of them.
i) Add code in header.php file
To add the code on your WordPress site, go to ‘Appearance > Theme Editor’. Then scroll through the files until you find the right one and click to open and edit it. Simply edit the header.php file in your WordPress theme and paste the Google Analytics tracking that code you copied earlier right after the <body> tag.
Don’t forget to save your changes by clicking the ‘Update File’ button.
ii) Add via Functions File
You can also add Google Analytics tracking code to the WordPress functions file. It will then automatically add the tracking code to every page on your WordPress site.
Search for function.php file on your theme editor.
Just add this code to your theme’s functions.php file and save the change.
<?php
add_action('wp_head', 'wpb_add_googleanalytics');
function wpb_add_googleanalytics() { ?>
// Paste your Google Analytics tracking code from Step 4 here
<?php } ?>
How to Track WordPress Site User Activities?
We will explain to you how you can track your user activity, in two steps. If you installed your Google Analytics by adding code on your theme file then skip step-1 and follow step-2.
Step 1: Activating User Tracking in MonsterInsights
Go to ‘Insights>Addons’ and search for the ‘eCommerce’ addon. Install and activate the addon.
Once you activated the addon go to ‘Insights>Settings>eCommerce’. Now scroll down to User ID Tracking and click on the option that says ‘Enable User ID tracking’.
Step 2: Enabling User Tracking in Google Analytics
Now you’ll need to enable user tracking in Google Analytics and create a new User ID view. So, log in to your Analytics account and select the website where you want to set up the user ID. Next, click on ‘Admin’ from the options on your bottom-left.
Now, click the ‘Tracking Info’ in the middle column and click the ‘User ID’ below. Then you’ll see the User-ID Policy on the expanded area. Click the toggle under ‘I agree to the User-ID Policy’ to switch it ‘ON’ and then click ‘Next step’.
Next, you can leave the option of ‘Session Unification’ to ‘ON’ and click ‘Next step’.
Click the ‘Create’ button to set up User-ID view in your Google Analytics.
You’ll now be taken to a page where you’ll have to enter the details of your user ID reporting view. To start, enter the name for your reporting view and select the reporting time zone for user ID tracking. Also, make sure that you switch ‘ON’ the option for ‘Show User-ID Report’. Then click ‘Create View’.
And finally, you’ve successfully created a user ID view. Google Analytics will give you a success message if you, then it will revert to the Admin screen and you can now track your WordPress user’s activities.
How to Check WordPress Site User Activities?
To see user activities tracking report you have to wait at least 24 hours after creating user ID view.
To check the report firstly, go to ‘Users > All Users’ where you can see all of your subscribers. Then hover your cursor over the user whose ID you want to find. You’ll see a URL appear at the bottom of your browser. In the middle of the URL, it will say “user_id=”. The number after that is the user’s ID number.
Now, go to ‘User ID View’, click ‘Audience > User Explorer’ to see your user data.
If you want more detailed info of each user click on the user ID of that user.
Hope this article will help you to track your WordPress user activity with Google Analytics. If you face while following the steps don’t forget to comment so that we can help you to resolve your issue. Also, visit our Tips & Tuts section to get more and more informative articles.
Image from www.google.com
Web analytics is very important to grow your site. Whether you have an e-commerce site or an informative site, you want to understand your visitors’ behavior to deliver better results. Web analytics tool gives you data of your visitors to identify what they are doing and how much time they are spending on your site. You can use any web analytic tools to track your user activities, but we prefer Google Analytics. So, in this article, we will talk about Google Analytics and how to track user activities in your WordPress site using Google Analytics.
What is Google Analytics & Why does it Matter to Your WordPress Site?
As with other web analytics tools, Google Analytics allows you to track user activities and understand your customer’s behavior, user experience, online content, device functionality and more. It provides you with the information you need to shape the success strategy of your business and things you probably never knew about visitors on your site.
Below are some of the reasons why we prefer Google Analytics to track user activities.
How to Install Google Analytics on your WordPress site?
The first thing you need to do to track your user activities on your WordPress site using Google Analytics is to install Google Analytics on your website. There are different ways to install Google Analytics on your WordPress site. But today we will show you the two easiest ways. One is using a plugin and another is by adding code to your theme file. But before following any of those two steps, you need to signup for Google Analytics. So, let’s move on____
Signing Up for Google Analytics:
Step: 1
To signup for Google Analytics, you need to login into your Google account first. Visit Google Analytics and log in to your Google account. If you don’t have one then create one first.
Step: 2
Now, you will be redirected to the following page. Press the ‘Start Measuring’ button here.
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.
Step: 3
And now, they will give you choice to choose between a web, apps, or apps and web. Make sure you select ‘Web’.
Then, you need to enter website name, website’s URL, country, and time zone.
Once you have added all of this information, click on the ‘Next’ button. At this point, they will show you Google Analytics terms and services, click on the ‘I Agree’ button.
Step: 4
Now you will be presented with your Google Analytics tracking code. Copy this tracking code because you will need to enter it in your WordPress site if you choose the manual method of adding Google Analytics on your site.
Finally, you signed up for your Google Analytics account. So, let’s jump into the installation methods.
1. Install Google Analytics with Plugin:
For the first method, we’ll use a plugin to add Google Analytics to your WordPress site. The best Google Analytics plugin for WordPress is MonsterInsights. MonsterInsights is the best and easiest way to add Google Analytics to WordPress for both beginners and experts. To set up analytics with MonsterInsights, follow these simple step-by-step instructions.
First, you need to install and activate the MonsterInsighter plugin. To install the MonsterInsights plugin navigate to ‘Plugins > Add New’ from your WordPress dashboard. Then click ‘Choose Now’ to find the plugin .zip file on your computer and click the ‘Install Now’ button. When you purchased your copy, you will have received a license key, verify with that license key.
Once your license is verified, scroll further down the page and click the ‘Connect MonsterInsights’ option.
This will redirect you to another page where you can authenticate your Google account. Then you’ll see a message from MonsterInsights asking for permission to access your account. To provide access, go ahead and click the ‘Allow’ button.
On the next page, you can select the website you’d like to collect data for. To complete the process, click on the ‘Complete Connection’ button and that’s it.
Now you can check Google Analytics reports directly on your WordPress dashboard. For this, you need to click on ‘Insights > Reports’ from within the WordPress admin area. You’ll then see the reports right on your screen.
And if you scroll down your page, you can view more details, including your top referrals, top posts and pages, top countries, bounce rate, and more.
2. By Adding Code on Theme File:
This method can be a little bit tricky if you are a beginner because your code will disappear if you switch or update the theme. It’s essential that you use a child theme so that your tracking code won’t be overwritten every time you update your WordPress theme. Before you make any changes, though, it’s always good practice to make a backup.
First, you will need to copy the Google Analytics tracking code that you copied earlier in Step 4 when signing up for a Google Analytics account.
Now there are two common ways to add this code in your WordPress theme files. You can choose either one of them.
i) Add code in header.php file
To add the code on your WordPress site, go to ‘Appearance > Theme Editor’. Then scroll through the files until you find the right one and click to open and edit it. Simply edit the header.php file in your WordPress theme and paste the Google Analytics tracking that code you copied earlier right after the <body> tag.
Don’t forget to save your changes by clicking the ‘Update File’ button.
ii) Add via Functions File
You can also add Google Analytics tracking code to the WordPress functions file. It will then automatically add the tracking code to every page on your WordPress site.
Search for function.php file on your theme editor.
Just add this code to your theme’s functions.php file and save the change.
How to Track WordPress Site User Activities?
We will explain to you how you can track your user activity, in two steps. If you installed your Google Analytics by adding code on your theme file then skip step-1 and follow step-2.
Step 1: Activating User Tracking in MonsterInsights
Go to ‘Insights>Addons’ and search for the ‘eCommerce’ addon. Install and activate the addon.
Once you activated the addon go to ‘Insights>Settings>eCommerce’. Now scroll down to User ID Tracking and click on the option that says ‘Enable User ID tracking’.
Step 2: Enabling User Tracking in Google Analytics
Now you’ll need to enable user tracking in Google Analytics and create a new User ID view. So, log in to your Analytics account and select the website where you want to set up the user ID. Next, click on ‘Admin’ from the options on your bottom-left.
Now, click the ‘Tracking Info’ in the middle column and click the ‘User ID’ below. Then you’ll see the User-ID Policy on the expanded area. Click the toggle under ‘I agree to the User-ID Policy’ to switch it ‘ON’ and then click ‘Next step’.
Next, you can leave the option of ‘Session Unification’ to ‘ON’ and click ‘Next step’.
Click the ‘Create’ button to set up User-ID view in your Google Analytics.
You’ll now be taken to a page where you’ll have to enter the details of your user ID reporting view. To start, enter the name for your reporting view and select the reporting time zone for user ID tracking. Also, make sure that you switch ‘ON’ the option for ‘Show User-ID Report’. Then click ‘Create View’.
And finally, you’ve successfully created a user ID view. Google Analytics will give you a success message if you, then it will revert to the Admin screen and you can now track your WordPress user’s activities.
How to Check WordPress Site User Activities?
To see user activities tracking report you have to wait at least 24 hours after creating user ID view.
To check the report firstly, go to ‘Users > All Users’ where you can see all of your subscribers. Then hover your cursor over the user whose ID you want to find. You’ll see a URL appear at the bottom of your browser. In the middle of the URL, it will say “user_id=”. The number after that is the user’s ID number.
Now, go to ‘User ID View’, click ‘Audience > User Explorer’ to see your user data.
If you want more detailed info of each user click on the user ID of that user.
Hope this article will help you to track your WordPress user activity with Google Analytics. If you face while following the steps don’t forget to comment so that we can help you to resolve your issue. Also, visit our Tips & Tuts section to get more and more informative articles.
Sidratul Sohrat