Attend FREE Webinar on Digital Marketing for Career & Business Growth Register Now

Learn To Install Google Analytics For WordPress Site

Rate this post

It is important to know how your audience interacts with your website or blog site. In fact, it can be said that if you know this, then you are on your way to running a successful blog. And how would you get this vital information? Through web traffic statistics analysis done by web analytics tools. One of the most widely used web analytics tool is the free-to-use Google Analytics.

Here, we will tell you why Google Analytics is necessary for you as a serious blogger and how-to install Google Analytics for your WordPress blog site.

Why Google Analytics for Bloggers?

Google Analytics is an important tool for serious bloggers because it helps you keep track of –

  • Who visits your blog?

The geographical locations and the demographics of your visitors, what device are they using to see your blog, what browser do they use, the screen resolution of their device, the default language and many other vital data can be extracted with Google Analytics. Knowing all this information can help you keep your blog compatible with the various devices, browsers, resolutions so that the viewing is not hampered for your visitor.

  • What they do on your blog?

The pages visited by the visitor, duration for which they lingered on each page and on your blog site, where from did they exit your blog, did they leave from the very first page they saw, and other such metrics. This helps you to decrease your bounce rate (users who left as soon as they arrived on your blog), increase the depth of your pageviews by doing some content management.

  • When do they visit your blog?

If you know the peak hour of traffic on your blog, you can post your blog around that time so that there are maximum views. In case your visitors are from different time zones you can schedule publishing your post according to those time zones.

  • How do they arrive on your blog?

Whether your visitor came to the blog via search engines (Google, Bing, Yahoo, etc) or they came through some other website or from Facebook/Twitter links. Knowing this can help you immensely to get more such visitors by targeting that traffic. If it is from Facebook or Twitter, you can tailor your content such that it is appealing to the Facebook or Twitter users. If it is from another website you can think of partnering with them by mentioning their links so they benefit from you too.

  • How they interact with your blog site content?

Knowing what your visitor did while on the blogs reveals interesting information. Did they click on links (internal and external), ads, photos, and other such site interaction metrics. To know what works with your audience you can run A/B split testing to see what content is liked by what percentage of your audience and more.

Now that you know the importance of why Google Analytics is important for your WordPress blog, let us see the steps on how to install it for your site.

Step 1 – Create a Gmail account

Start by creating a new Gmail account if you don’t have one already. In case, you do have a Gmail account, simply log on to Google Analytics using your existing Gmail id. You will see a page like this –

Step 2 – Sign up for a Google Analytics account

Once you sign in through your Gmail account, you will be asked to sign up for a Google Analytics account which will be linked to your Gmail account.

Step 3 – Fill necessary information

After signing up, you will be directed to a page that asks you whether you want to track a website or a mobile app. Select website.

Then it may ask you to choose between their beta version of Universal analytics or classic analytics. You can choose either. Even if you choose a non-beta option, you will be upgraded to it once their testing is done and they launch the new upgrades. So, feel free to choose any option. This page will come only if Google Analytics is doing some beta testing.

The remaining information that has to be filled is pretty much self explanatory – website’s URL, Account name, country, time zone, etc. Once all this is filled, at the bottom you will get the Get Tracking ID button. On clicking it, you will be shown the terms and conditions for using Google Analytics which you have to agree to.

Step 4 – Tracking code

After clicking on I Agree button you will be shown a Google Analytics tracking code. You can copy and keep it because this is the code that you need to enter in your WordPress site.


Keep the Google Analytics tab open. You will need it for copying of your Universal Analytics tracking number (UAN) and you need to revisit the Google Analytics account after installing it on your WordPress account.

Step 5 – WordPress site

Once you have your tracking code and UAN, you have three ways of installing Google Analytics for your WordPress blog site.

  • Plugins method (easy and recommended)

Just install a plugin, which are available in tons on WordPress. Choose a simple lightweight plugin like Insert Header and Footer. You have to simply copy-paste your UAN into the plugin’s setting page and it is done!

  • Direct paste method

You can copy-paste the code received in Step 4 into your theme’s header.php right after you see the <body> tag. Once you do this, you are good to start tracking your blog.

  • Functions.php method

Note: Use this method only if you know what you are doing.

Add the code shown below in your theme’s functions.php file. Don’t forget to paste your Google Analytics code from Step 4 here.


After this, go back to your Google Analytics account and press Save. You can now click on your Reporting tab and see your blog’s analytics overview. Wait for 24 hours to get actual actionable insights for your site.

Note – This installation guide will work for self-hosted WordPress blogs and not for the free blogs.

Image Credits: wpbeginner

  • web-analytics

  • Your Comment

    Your email address will not be published.