Google Analytics Guide 101: How to Track the Traffic on WordPress Websites

Home

Did you just start your blog with Newspaper Theme? Great! In this article, we explain how to power up your website with valuable insights using Google Analytics. With accurate data about your audience – age, gender, location, traffic source (how they landed on your site), the most popular content on your website and conversions – you can plan effective business strategies and grow your business faster. Are you asking yourself why you should use it?

I’ve made a list of the four main reasons:

  • It tells you which channel drives traffic to your website
  • It shows you which marketing channels are better at converting the visitor to customer
  • It brings you data about the demographic characteristics of your audience helping you to be more effective
  • It enables you to analyze your efforts and pages based on data, not hunches.

The list can go on, but I think we can move on and start with the basics.

Google Analytics Guide 101: Step 1 - Create a new account

Analytics 101: How to set up your Google Analytics

Google Analytics is created by Google to help website owners understand their customers. If you are a publisher and your goal is to bring visitors back to read more of your amazing content or an e-commerce website that aims to get as many conversions, as fast as possible, Google Analytics is the free tool you need to analyze data and grow your business.

Create a Google Analytics account

To set up a Google Analytics account, you need a Google Account. Think of your Google account as the access point for all your Google products and tools. If you don’t have a Google account yet, it takes a few minutes to create a new one.

Google Analytics First step to setup a new account

Once it is done, you can create a new Google Analytics account. Click the button, and you’ll be redirected to the setup page. The Analytics help is quite comprehensive, and you’ll go through the process in no time.

Google Analytics Setup Your Account

You’ll need to give your Analytics an account name, enter your website name, and add your domain name. After you complete these steps, Google will automatically generate your tracking code for the website.

With this, the basic setup is ready. Theoretically, now all you have to do is add the Google Analytics script to the <head> tag and see the data flowing in after 24 hours. But practically, … it’s not! Think about it: how does Analytics suppose to know what actions are essential to you on your website? Are you selling something? Are you aiming for leads? It’s engagement on content vital? If you insert the script in the site now, you’ll be missing out almost all the goodies.

2. Clear objectives = Great, insightful data

Yeah! You must change the Google Analytics script to track actions and metrics that are important on your website. If you have some Java or PHP skills, you can do it by yourself. If not, you can hire a developer to do it for you as this step is a heavy technical one.

But first, you need to get things crystal clear in mind about your website objectives. Make a list:

  • What are the key pages, shopping cart pages?
  • File downloads like .pdfs, apps you want to track inside Google Analytics
  • On-page events like video views, forms, button clicks
  • Does this site need e-commerce tracking?
  • What are the critical conversion points like “thank you” pages, signups, lead capture pages, newsletters?

After generating this list, you should have a clear idea about what do you need to track as actions and conversions on your website. Your Google Analytics should focus on your essential metrics and help you to reach your objectives. Let’s see some example of objectives with potential Key Performance Indicators defined.

According to Klipfolio
A Key Performance Indicator is a measurable value that demonstrates how effectively a company is achieving key business objectives. High-level KPIs may focus on the overall performance of the business, while low-level KPIs may focus on processes in departments such as sales, marketing, HR, support and others

Objectives and KPIs

Objective Pageviews/traffic:
Potential KPIs: Total pageviews, sessions by source/medium, top landing pages, top organic keywords, page value, time on page, goal conversions.

Objective e-commerce/sales:
Potential KPIs: Total revenue, e-commerce conversion rate, page value, conversion rate by source/medium, sales by product category, return on ad spend (ROAS), conversion rate by gender/age and interest category, conversion rate by external campaign name.

Objective lead generation:
Potential KPIs: Goal conversions, conversion rate by landing page, page value, conversion rate by source/medium, conversion rate by gender/age and interest category, contact form submissions by landing page.

Objective affiliate/commission-based programs:
Potential KPIs: Outbound clicks per landing page, content group conversion rates, page value, traffic by source/medium, top landing pages, top external links clicked by page.

Decide what are the most valued KPIs for your website’s objectives and customize the tracking code to make sure this fantastic tool called Google Analytics brings you all the essential metrics in a way you can easily understand and make strategic decisions.

3. How to customize the tracking code to see everything that’s important

If you are selling something on your website, the first thing you’ll want to do is activate the Ecommerce tracking. Navigate to the Admin panel > View level and enable the Ecommerce settings. That’s easy. Now comes the technical part. Head over Google Analytics reference guide and check the instructions for sending data about transactions and/or item metrics to your Google Analytics.

ga('ecommerce:addTransaction', {
'id': '1234',                     // Transaction ID. Required.
'affiliation': 'Acme Clothing',   // Affiliation or store name.
'revenue': '11.99',               // Grand Total.
'shipping': '5',                  // Shipping.
'tax': '1.29'                     // Tax.
});

For content creators and publishers, e-commerce tracking is useless. Adding custom dimensions like Author or seeing engagement on AMP traffic in Google Analytics, it’s another story and could be a gold mine to grow your website.

ga('send', 'pageview', {
'dimension5': '<!--?=$author?'>
});

After you’ve made all these customizations on the code, it should be ready to install on the page.

4. Installing the Google Analytics script in Newspaper Theme

Go to your Google Analytics Account > Admin panel Property, open the Tracking Info section, and click the Tracking Code option. Copy the Global Site Tag and add the sitewide customizations you’ve made in the previous step. Here is an example of customized code.

ga("create", "UA-XXXXXXXX-1", "auto", {
name: "author_analytics",
allowLinker: true,
storage: "none",
clientId: clientId,
alwaysSendReferrer: true
});
} else {
ga("create", "UA-XXXXXXXX-1", "auto", {
name: "author_analytics",
allowLinker: true,
alwaysSendReferrer: true
});
}
ga("author_analytics.send", "pageview");

When you are using the Newspaper Theme or a Newsmag Theme on your website, adding the tracking code is easy. Navigate to your website WordPress Admin area > Newspaper > Theme Panel > Analytics/JS Codes section and paste the code in the “Head Script Code” box. Hit the Save Button.

Newspaper Theme: How to add Google Analytics code to track traffic on WordPress Website

Now, verify if the code is present in the page by opening the page in the browser, in the Incognito mode, and search in the source of the page for “gtag.js.”

Tip: If you are using a caching plugin, consider clearing the cache after adding the Google Analytics tag.

The Newspaper Theme will automatically insert your script on every page, sitewide, and you don’t have to worry about it. Even after updating the theme and/or WordPress, your tracking will still be present on your WordPress.

In Newspaper Theme, you can add all the tracking codes in the Analytics section and forget about them.

5. Using Google Analytics Events

After you’ve added the script, you should see the data about your traffic flowing in the first 24 hours. You can see insightful data about your audience: age, sex, location, where are they coming from, how do they interact with your pages.

But when dive into data, you’ll notice that your tracking is at the page level, and this means that you can’t see any data about how visitors clicked the buttons, links, calls to action or video plays. For this, you still need to take an additional step and create events for Google Analytics.

What is a Google Analytics event?

According to Google, “events are user interactions with content that can be tracked independently from a web page or a screen load (…) Downloads, mobile ad clicks, gadgets, Flash elements, AJAX embedded elements, and video plays are all examples of actions you might want to track as Events.”

You can also use Google Analytics Events to track interactions like:

  • Number of clicks on a button
  • Number of clicks to outbound links
  • How much time the audience watched a video
  • Form abandonment
  • Number of times users downloaded a file
  • Number of times visitors shared a blog post

The event tracking code has four elements: category, action, label, and value. The tracking code snippet example:

onclick=ga(‘send’, ‘event’, [eventCategory], [eventAction], [eventLabel], [eventValue]);

Replace the placeholders with your customized elements based on the events you want to track. Then place the entire code snippet on your page.

Newspaper Theme: Adding Tracking on button for newsletter in tagDiv Composer

After you’ve made the change to the code, you can track the activity on buttons or form submissions. In the Newspaper Theme, you can add events right on the element. Simply add the info into the Tracking section, and the theme implements it for you.

Tip: Don’t forget to generate a list of the events you need to create to reach your website objectives. The purpose is always to have a clear image of your events, as Google Analytics is generating so much information that is easy to lose track of the essential.

6. Tracking traffic with UTM parameters

If you want to track your efforts to drive traffic to your website from your email, PPC, and referral traffic using Google Analytics, you need to use campaign tracking. You can easily create UTM parameters and bring external data to your Google Analytics account.

I’ve shown you how to customize the tracking code to send meaningful data to your Google Analytics account to help you understand who is your audience and how your visitors interact with your website. The Campaign tracking doesn’t require the modification of the tag in the site, as it is used on the link level.

What are the UTM (Urchin Tracking Module) parameters?

“UTM parameters are simply tags that you add to a URL. When someone clicks on a URL with UTM parameters, those tags are sent back to your Google Analytics for tracking.”, according to Kissmetrics.

The structure of a link with UTM parameters for campaign tracking

The UTM parameters and UTM tracking are straightforward to use and highly effective in finding out which links are the most effective in driving traffic to your content.

There are five UTM parameters:
utm_source – Identifies which site sent the traffic like Facebook or your email newsletter, and is a required parameter.
utm_medium – Identifies what type of link was used, such as cost per click or social media, affiliate, and so on.
utm_campaign – Identifies a specific product promotion or strategic campaign.
utm_term – Identifies search terms.
utm_content – Identifies the clicked content that brought the user to the site. It is a good solution for A/B testing and content-targeted ads.

How to create a link with UTM parameters?

Let me introduce you to the Google Analytics Campaign URL Builder. It’s a form inside the Google Analytics help center. You can complete it to add the information to your link automatically. When you are done, copy the link and paste it where you need it. No coding skills are required.

Analytics Campaign URL Builder: How to create a custom UTM Parameters

URL tracking is straightforward to set up and use providing precious insights about your traffic. But, only if you send data into a clear, easy to understand way.

Be consistent with your UTM parameters

Create a convention to help you be consistent in naming your campaigns and avoid a lot of confusion in data analysis. The recommendations are simple:

  • Use dashes
  • Don’t repeat yourself
  • Keep it simple
  • Make your parameters easy to read

Track your UTM parameters in a spreadsheet

Make your life easy and record all the links with parameters in a spreadsheet. Every time you need to create a new one, you’ll know exactly what campaigns and parameters you’ve already used.

Also, it will help your team use the same conventions, ultimately keeping your Analytics data clean and clear. You can use a free spreadsheet template like the one shared by Sam Wiltshire to get started or simply create a new one.

Wrapping up

Now, that you have the tracking setup on your website and you are receiving data from your marketing efforts, take a look at the reports in Google Analytics at least once a week. Tracking the traffic on your website is the first step you make to grow your online business, whether you are a publisher or an e-commerce website.

How to track the traffic on WordPress websites article explains how to get started with Google Analytics and basic campaign tracking. Do you track your traffic on the website? Are you using Google Analytics? Did it lead to surprising discoveries about your visitors? Let us know in the comment section below.

Subscribe For More!

If you want to be the first to find out more about our themes
please subscribe to our newsletter

Alina S.
Alina S.
I am a WordPress enthusiast, digital and content marketer, copywriter, and sometimes storyteller. Originally trained as a journalist, I have a curious mind. I enjoy testing new technologies, discovering new ways to make things easier, and, especially, telling everybody stories about my discoveries. At tagDiv, my work focuses on designing great experiences for our visitors and customers.

10 COMMENTS

    • Hi,

      Unfortunately, our theme does not have any such an option for Cookies, sorry! Try to use some plugins which have this functionality.

      Thank you!

  1. Great post with detailed instruction, but can you guys write & share about google tag manager too, i’ve been struggling with it
    many thanks 🙂

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Check out our latest

Stories