Google Analytics: Add Tracking Code To Your Website.

Hello Friends,

In this tutorial, I am going to let you know about the how to add google analytics tracking code to your Blog or Website?What is this tracking code?

This is a piece of code written in javascript, this code helps you to let you know that how many people visit your website and perform some events on your
a site like clicks and etc.

With the help of google analytics, you can get lots of information about your site visitor.

You can also find out the source of traffic and some other stuff like their demographics.

You can also track who are viewing your site live, and how much time they spent at your site.

Google analytics really made it easy to track all the activity happening on our website.

What is the benefit of this tracking?

With this tracking information one can easily analyze the site performance and can impromise to their site if needed.

Our site stats inspire us to work hard and more, they also show the direction or strategy to work on where we are getting more traffic.

How to get this Google Analytics code for your website?

This is a very simple procedure. You just need to follow step by step procedure given below.

Login to your Google Analytics account.

For integrating any website with Google Analytics your need to make an account for your website and thus it generates a property and a default view for your website.

So first you need to create an account for your website.  Click on Admin as shown in the image below.


Here you can create a new account for your website. See the image below for the same.


Here enter all your required website details. See the image below.


After entering all the fields, just click on Get Tracking Id. See the image below.


Click as shown in the below image.


This is your Google Analytics tracking id and tracking code. See the image below.

Your Tracking ID is also used when you use any WordPress plugin for Google Analytics Tracking.


Now where to paste this Google Analytics tracking code? is it necessary to add the code in the header.php page or inside the head or body section?

When you create an account or property for your website, then you allow to Google to monitor your website.

If you don’t add the google analytics tracking code to your page, you would still get the analytics for your website as you have already created the property for your website.

But it will be overall data for your website, but if you want to track your website specifically page wise, event wise, campaign wise, then you can add this google analytics tracking code to your page and post.

You can also paste this code into the body part of header.php and into your WordPress posts.

So here we are showing how to add the code inside the header.php page.

Now, login to your WordPress dashboard. See the image below.


Click on the editor as shown in the image below.


First, select your activated theme and then click on the page header.php. See the image below.


Here paste the Google analytics tracking code inside the <head> section. See the image below.

Once you will paste this code. you will start getting the stats for your site in your Google Analytics account.


Once you set the property or add the google analytics tracking code to your website or pages, within 24 hours you start getting the stats for your website. These stats are regularly updated in every 24 hours. See the image below


In a case of any queries, you can write us at we will get back to you ASAP.

Hope! you would have enjoyed this post Google Analytics.

Please feel free to give your important feedbacks in the comment section below.

Have a great time! Sayonara!