Hi Buddies! Welcome back!! So now that you have launched your WordPress website and you think it’s time to know how people interact with your website and are eager to install Google analytics on your WordPress website.
Please read further as I guide you to set up google analytics account, the most popular website tracking and analytics tool for your WordPress website and also provide answers to all your questions like “how to use google analytics on website”.
So What Is Google Analytics All About?
Google Analytics is one the most popular and widely used website tracking and analytical tool used by every personal and business website owner to track user behavior and generate detailed reports on the:
- Traffic generated
- Traffic source
- Type of audience
- How they interact and overall performance of the website etc.
No other tool has come close in tracking user behavior like Google Analytics, as you can use these important user data to take very important decisions for the betterment of your website and your business simultaneously.
Why Is Google Analytics Important for Your WordPress Website?
Starting your own website means you wish to accomplish some goals, like creating a blog, to talk about your passion or to start an eCommerce store to sell your products online or just to create a personal website about yourself.
But whatever your goal is, you need to understand what kind of user’s visit your website and what are the traffic sources that drive them to your website, how long one stays on your website and which is the page that is popular or what product is being viewed the most.
Without this information on your hands, you could never envisage what is ahead of you and move your website to the next level.
Google Analytics is one tool that every webmaster would dream of as it provides all of this data for free. All it takes is an hour of your time to install WordPress onto your website, and you will enjoy the features provided by Google Analytics.
Installing Google Analytics on your WordPress Website
Now you’ve understood what Google Analytics is all about and how it could be beneficial to your website, it’s time to see how to add Google Analytics to your website.
You need a Google Account if you want to add Google Analytics to your website. Go here to create one.
Once you’ve created your new Google account, please click here to go to the Google Analytics page and login to your account and fill all the information that is needed to set up analytics.
Once you are done with setting up your Analytics account, copy the tracking code as shown in the picture below:
You can install Google Analytics on your website in several ways.
Method 1: Manually add by editing header.php file
This is a no-nonsense method, but involves some basic knowledge about WordPress and how to edit pages in WordPress.
- Now login to your WordPress admin and go to Appearance -> Editor to launch the editor window.
- At the right of the editor, you can see the list of file names, select click header.php,
- Now search for the tag </head> in the header.php code and paste the tracking code you copied from the Google Analytics website before the tag </head> like this:
- Click the “Update File” button to complete the process and go back to the Google Analytics page where you copied the tracking code. You can check the status by clicking “Send Test Traffic” button. It normally takes minimum 24 hrs to see some actual data and later you can click the “Reporting” link in the main menu to see all your analytics reports.
Method 2: Add Using a WordPress Plugin
Even though there are many plugins available to add Google Analytics to your WordPress website, the Google Analytics plugin by MonsterInsights is one of the best option. MonsterInsights was formerly known as Yoast.
- Go to the download link and download the latest version of the plugin.
- Now login to your WordPress Admin section and go to the “Plugins” section and click “Add New”, this will open a window where you need to select the location of the downloaded plugin file and installation will start automatically.
- Next, you need to activate the plugin and visit the Google Analytics authentication page.
- There you need to copy the authentication code and paste in the specified field marked there.
- You can also see a detailed manual here on how to install Google Analytics plugin
- Now Click Authenticate and that’s it, your google analytics is up and running.
Method 3: Manually add by editing functions.php file
Another method to setup Google Analytics is by editing the functions.php, instead of the header.php. But here, you need to add a small snippet of code to the functions.php.
- Login to your WordPress admin section
- Go to Appearance -> Editor
- And select the functions.php file
- And add the following code specified below:
<?php add_action(‘wp_head’, ‘add_google_analytics’);
function add_google_analytics() { ?>
// Paste your Google Analytics code here
<?php } ?>
- In the area where it says, “Paste your google Analytics code (remember you’ve copied the tracking code) just paste the tracking code here and click update file.
- That’s it you are done setting up google Analytics tracking to your website
Conclusion
All the methods that are described above should work seamlessly if you follow the guidelines properly. Whatever method you choose, please make sure to verify again that every step has been implemented correctly and verify it again by visiting and logging into your Google Analytics account to see if you can see any data is being gathered.
If you still want to know, whether you really need Google Analytics, please go through the following link to learn more about it.
To get more such articles directly to your mailbox Subscribe to eMoneyIndeed now.
We hope you found this article useful and informative as always. Do leave your valuable comments below and don’t forget to share this article with your friends.
- Go Start Your Own Blog Now.