Document

A Beginner’s Guide to Google Analytics for WordPress

Let me tell you one thing that you probably already know: write what your readers want to read (it even applies to the case that you write for yourself). So how to define what your readers want to read? Let’s ask my friend Google Analytics (GA); he has lots of information about your customers, such as how long they stay on your website, where they are from, and what they mostly read. Cool huh? First things first, shall we meet this awesome guy?

What is GA and why should you use it?

Google Analytics is a tool from Google that provides insights into your website for FREE! It shows how people are using your website on each platform, for how long, their basic demographic info, and even their interests.

Now can you guess why we should use it? Yes, you’re right. GA helps us know our audience and how to target them. For instance, you can easily know what time your audience mostly visit your website so you can choose when to publish a new blog. You can also focus on what they like by knowing their location or which entries they read the most. More information can be found here.

It’s all about your customers’ experience, and GA can definitely help you with that.

This beginner’s guide will show you how to install this awesome tool on your website and start growing with it.

Sign up for a GA account

Step 1.

Visit Google Analytics Signup Page and sign up with your Google account (if you don’t have one, please register one.)

Follow the instructions and choose what suits you the most.

Step 2.

After registering, you will see there is some Google Analytics tracking code. Copy this code and head to your WordPress website.

Install GA in WordPress

There are at least three ways to install GA. You can choose among directly pasting it into your theme, your functions.php, or using a plugin. Well I prefer a plugin: it’s quick and stable, and there is no need to edit any other files. Still, let me walk you through all three methods.

Directly pasting into your theme’s files.

Copy the tracking code and paste it into your theme’s files such as header.php (located in your current theme’s folder). You can go to your Dashboard > Appearance > Editor. Open your theme’s header.php file and paste the code under the <body> tag.

Remember to save the file.

Edit functions.php

Note: only do this if you are sure what you are doing. Editing functions.php may make your website work improperly.

Open your theme’s functions.php file and paste the following code (remember to also add GA tracking code)

<?php
add_action('wp_footer', 'add_googleanalytics');
function add_googleanalytics() { ?>
//GA tracking code goes here
<?php } ?>

My favorite: Using a plugin

Okay lazy folks, here comes the solution. There are tons of GA plugins for WordPress, and all you need is to install the plugin you like and insert your GA ID (the one that starts with UA- that can be found in your GA profile), the plugin will do the rest. Time saved.

My suggestions? You may try one of these plugins, they are all good and free:

Google Analytics for WordPress by Yoast

Brought to you by the famous plugin creator Yoast, this plugin is very easy to use. Just type in the UA code and that’s it. As powerful as you need it to be and simplifies the process for adding Google Analytics tracking for your website.

Google Analytics Dashboard:

This plugin helps a lot in quick tracking of traffic and improves understanding of user behavior. Quick reports and real time tracking datapoints give ultimate support while you work online.

Google Analyticator

This plugin integrates Google Analytics preview in the WordPress dashboard. It gives you almost complete control over the GA code, but doesn’t require you to spend ages messing around, if you don’t want to.

Another option is to use a plugin that allows you to insert custom code into your theme’s files, such as Insert Header and Footer. You can paste the GA tracking code there and then there is no need to worry whenever you change your theme.

Using Google Analytics

Once you’re done installing GA to your website, you can go back to GA dashboard and test if the connection is okay.

It normally takes GA 12 to 24 hours to gather your first stats, so be patient if the awesome information hasn’t shown up yet.

Meanwhile, start learning how to read your GA dashboard on its official website. I know it’s boring, so here is a little less boring version of it on Mashable.

SEO’Brien wrote a wonderful post here about how to utilize GA. Don’t get confused with the title, it is handy for all of us. Seriously, if this guy ever publishes a GA Book For Dummies, I will be the first one to buy it.

Wrapping Up

Google Analytics is a must-have tool if you are serious about attracting more customers to your website. The only drawback of GA is that it can be used on a self-hosted WordPress website only.

So, are you ready to boost your sales, serve your current customers better, and win new ones with Google Analytics? Don’t forget to share your story with us.

by Chau Cao

Chau is an ordinary person who occasionally has extraordinary thoughts. People often find her innovative, helpful and knowledgeable but most of the time, weird. Deep down she is just an introvert sarcastic foodaholic with a big heart (and stomach) and an open mind. Chau loves writing as much as spending a rainy afternoon with her cat and a cup of tea.

Leave your comment

Ready to Sell Online?

Build Your Online Store with WooCommerce & Nitro Theme

Read more
Contact

Touch With Us