WPKube

Getting Started With Google Analytics In Your WordPress Site

Every website, be it a blog or a company site thrives on its audience. Without them, your website will be a futile attempt to achieve your goal. That is why being able to interact with your audience is pertinent for your web endeavors.

Of course, this can be achieved by producing good content. But the variety or the scope of said content still depends on the needs and wants of the people who visit your site. One of the best ways to analyze your visitors and how it affects the traffic of your website is Google Analytics, and in this article, we will discuss how important this tool is and how you can use it for your WordPress Blog. But first, let’s answer an important question.

Is Google Analytics Even Important?

Short answer: yes.

Google Analytics allows you to keep track of many things in your website:

This makes it easier for you to study your audience and control your content as to what is received better and what doesn’t perform well.

With Analytics, you can also keep track of specifics of your audience. Using the features under Audience in your Google Analytics Dashboard, you can see the geographical location of your audience, the browser they use, the screen resolution of their monitors and how long are they staying in your website. This proves to help you fit your content and design with the specific type of audience you are targeting.

This proves to help you fit your content and design with the specific type of audience you are targeting.

For example, if you are a Viral content media site, Analytics will help you see which of the stories you publish are actually received by your viewers. You can also use it to determine if the design you are using, and the technologies that are inculcated in it fit the needs of the users.

Analytics also allows you to know what your visitors are doing when they are in your site. Using this tool, you can see which pages your user is going and the duration of their stay. You can also know the bounce rate of your users.

Bounce rate is the percentage of users that leave your site without visiting any other page except the one they initially visited. Knowing your bounce rate will help you facilitate inbound links that direct your user to more content from your website.

Using Analytics will also allow you to see when your users are visiting. Through this, you can know the peak hours of the day where you can publish your posts.

In addition, Analytics also allows you to determine where your users are from. Are they a product of search engines? Social sites? Referrals? Or direct? This allows you to understand which aspect of traffic you need to focus on. If your site is performing great on social media, then you might want to increase your efforts to get visitors from other channels.

How Will I Be Able to Use Google Analytics for my Blog?

Enabling Google Analytics on your site requires a few steps. Let’s begin with creating a Google Analytics Account. To do this, you need to go to the Google Analytics website and sign up there.

Now if you already have a Gmail account, you can use that to sign in. If not, then you have to create a new account.

Sign up for Analytics using your Gmail account

Next, after successfully signing in using Gmail, you will be directed to a page that looks like the image below.

Google Analytics Homepage

Click Sign In, and you’ll be directed to this screen. (see below) Next, click Sign Up.

After that, you will be asked if you are using Analytics for a mobile app or website. If you are tracking your blog, then you should choose the website option.

Choose Website Option

Then, you need to fill in the details of your property. You’ll need:

This form is just basic so you shouldn’t get into much trouble for this step.

After successfully filling the form up, you need to click on the button that says Get Tracking ID. You will be prompted by a Terms Of Service Agreement (TOS). You should read and understand this. Then click on I Agree.

Doing this will give you the Google Analytics tracking code. You need to copy this code because you will need to enter this in your WordPress site. For that reason, I suggest that you don’t close the tab until you have successfully pasted the code on your site.

Now, we’re done with the Google side of things. Let’s go to your WordPress site.

There are two easy ways to install the Google Analytics Tracking Code in your WordPress website: Direct pasting method, functions.php-editing method, and via third party plugin. Let’s start with the easiest method first

Method One: The Plugin Method (Easiest)

First, you need to login to your WordPress site. To do this, you need to access your WP-Admin dashboard. It can be located at http://yoursite.com/wp-admin.

After logging in, go to Plugins then Add New.

Search for the Header and Footer Scripts plugin; install and activate it.

From there, you can paste your tracking code via the plugins setting page. (note: some themes have a footer and header script section. Double check to see if your theme has this option before using a plugin so that you can avoid the use of one.)

Method Two: The Direct Pasting Method (Not So Easy)

To do this, you need to copy the tracking code (exactly as given), go to your header.php file and paste the code after the <body> tag in the file. Some people who know their way around code can easily find this, but if you cant, then just try the plugin method above—it’s so much easier!  

A Third Method: Using the Functions.php (Should Not Be Done Unless You Know What You’re Doing)

There is a third option for installing the tracking code in your WordPress site. You can use the code found below to install your unique code in your functions.php file, but I really don’t recommend it.

<?php
add_action('wp_footer', 'google_analytics');
function google_analytics() { ?>
// Paste Your Google Analytics Tracking Code Here
<?php } ?>

This method can serious make your site go out of whack if done incorrectly, and if you’re the sorry bloke who makes the mistake then you’ll be big stuck with trying to troubleshoot an avoidable mistake, which can take hours.

If you know your way around this file, then feel free to add the proper code there. Everyone else should use one of the other methods stated above.

Conclusion

Google Analytics is a powerful tool to monitor your site performance. Thus, it is a must-have — especially if you are serious about blogging. Good luck in your blogging and online endeavors.