In this article, you will be learning How to add google analytics in WordPress sites with ease.
Google Analytics plays a very important part for a website from where you can generate traffic reports and access most valuable information of website visitors.
Google analytics is a free tool offered by Google, we can use it not only in WordPress but it is compatible for all the platforms.
after setting up your Google Analytics account and start analyzing your visitors.
We have covered two methods, so that you can choose your OWN WAY to add analytics in your website.
You have a couple methods for How to add google analytics to wordpress into your WordPress theme — through plugin or through the theme’s “header.php” file.
Inserting the google tracking code directly into your theme’s “header.php” file is fast and easy.
Using the help of a plugin to insert the google tracking code is the second method which is a little time consuming.
Would you simply paste the code using a plugin? If yes then follow this procedure.
INSERT HEADERS AND FOOTERS SCRIPTS:
If you are using WordPress sites then you must want to add some code for affiliate or tracking purposes but are somehow scared to do so.
Well, this plugin is the best solution for you.
Whatever code you want to add in your “header.php” file, this plugin does automatically.
This applies the tracking code to all pages of your site without a fuss.
First you have to, install and activate the plugin.
Go to the WP Dashboard > Click Plugins > search for “Insert Headers and Footers Script > click the “Install” button > and then click the “Activate” button.
FOLLOW THESE INSTRUCTIONS:
1. Go to WP Dashboard > Hover Settings > Click Insert Headers and Footers.
2. Copy your Google Analytics tracking code and paste it into the field named “Scripts in Header“.
3. Click the “Save Changes” button.
It’s that easy!
Would you simply paste the code into the theme file by yourself? If yes then follow this procedure.
INSERT CODE MANUALLY IN “HEADER.PHP” FILE
STEPS FOR MANUALLY ADDING CODE:
Go to WP Dashboard >Hover on Appearance > Click the Theme Editor Option > and open the file named “header.php” from the options available on the right side.
Toward the top of the code, look for the bit of code that looks like ““.
Now carefully add the code in the head section of the file without disturbing the existing code.
You can either place the code ABOVE of this or at the END of this , I will suggest you to paste the Google Analytics tracking code at the end but leave a blank line before pasting the code..
Save changes to the file when finished.
REMEMBER! Using this method of manually inserting the tracking code within your “header.php” file is fast and effective, though you’ll need to re-do this step if you ever change WordPress themes or update your theme.
For practical understanding see our video “How to add google analytics in WordPress” through plugin or manually.
Now you know how to add google analytics code in WordPress.
Once you have installed google analytics in your wordpress site, you will be able to uncover information about your website and its visitors. This includes through which platform users find your website, which page landed and from which page they exist, what your most popular blog or page is, and a whole lot more.
Follow the benefits:
- More information about your website – The first advantage of using google analytics is you can get so much information about your user that you can’t even imagine.
You can know the age and of the users, different countries of the users, source of users, which page/blog has maximum traffic, which mobile network your visitors are using, what kind of device they use like mobile, tablet and laptop etc.
So, this is one of the strong reasons to use google analytics.
- From which traffic source you get most users – You can full detailed information about the source of your traffic.
There are 5 sources of traffic: Direct, organic, social, referral and others.
Now you can see which source of traffic is highest, what is the bounce of rate of that source, how much conversion you got from each source etc.
- You can know what users are searching on your website – There is one feature on Google analytics which you once turn it ON, helps you can get information on “what your users are searching on your website”. This feature’s name is “Site Search”.
Isn’t it cool!
- Improve the Bounce Rate of Your Website – Suppose, you have not installed google analytics on your website.
Now what happens, you don’t have any information about your users. Right?
Due to which, you won’t be able to take steps to improve your bounce rate.
- You can track conversions – Google analytics give you one more awesome thing.
You can track your conversions.
- Set up Goals – You can set up your own “Goals”. By setting up goals you can track your objectives.
There are four types of goals in google analytics:
- Pages/Screens per session and
Below are just some of the features offered by this tool.
Demographics – In this report you can get information on two things:
(a) Age – Get information on how old your users are.
(b) Gender – Get information on which traffic is more on your website male’s or female’s.
Geo – In this report you can get information on two things:
(a) Language – Information on language settings in your users’ browsers and
(b) Location – The country from which the session raised.
Channels – Get information about the sources of your traffic. Now channels are grouped into 5 categories:
For example, Some famous websites like H&M, Zara, Adidas etc have higher chances of direct traffic. Why?
Because they are popular and well known by everyone.
Bounce Rate – It means when a user comes to a website and has no interaction.
Simply putting, it is a one page session.
You have just learned how to add Google Analytics to WordPress without a plugin and through manually.
I think we have solved your “where to add google analytics code wordpress” question in an easier way.
You can use any method which you think is suitable for you.
I hope you like our new article How to add google analytics in WordPress.
If you have any doubts or queries do mention it in the comments.
Don’t forget to share this article with your friends on LinkedIn and Facebook.