×

THATBlog

Consolidating Sets of Goals in Google Analytics

Posted at Apr 13, 2011 2:37:14 AM by Joey Wolff | Share

Recently, we wanted to improve our own goal tracking (on THATAgency.com) and wanted to share some of the details of how we did it. First (as always), let's start with our main goal: To gain visibility of 1) the total number of blog article 'shares' and 2) which articles are shared the most frequently. We define a 'Share' like this: A user who clicks one of the large social media sharing icons at the bottom of each post. See Below:

Step 1: Setup PageTracker

One way to track a click as a goal is to use JavaScript Event tracking with Google Analytics. What this basically does is 'trick' Google Analytics into tracking a pageview each time someone clicks any link that you tell it to. You'll want to track a pageview like this so that a goal can be setup (in Google Analystics) to record each time that 'fake pageview' happens. In our example above, we've amended each share link with the following:

onclick="javascript: pageTracker._trackPageview('/share/design-studio-blog/
2011/04/no-one-is-knocking-no-visitors-for-40-percent-of-uk-websites/');"

Within this link of code, we've included the 'fake' url which we'd like Google to track as a pageview. 2 important things to note:

  1. Each of our 'share' urls begins with "/share/" so that we can roll them up later wioth goal tracking
  2. Each of our 'share' urls contains the url of the blog post which is being shared so that we can run a report to see which Articles are shared the most frequently.

Learn more about setting up JS events here.

Setting up the Goal in GA

Now, we're going to go into Google Analytics to accomplish the first part of our goal: Tracking how many total shares do we get.

  1. Begin by going into the Goal Setup area of your Google Analytics account.
  2. Click Add Goal.
  3. Give your goal a description name, Article Shares
  4. For match type, choose Regular Expression Match. This type of matching will allow us the flexibility to wildcard the tracking url so that all 'shares' (regardless of which article or which social network) will get pulled in.
  5. Under Goal URL, we used /share/.* which basically tells Google to track all urls that start with /share/ as one single goal.

Create a Custom Google Analytics Report

Now that all our article 'shares' are tracking to a single goal, we can run a gauntlet of reports in Google Analytics which will show us the relationship between traffic sources, landing pages, users, etc. and our goal accomplishments. But next, we wanted to see which of our articles were share the most often. For this, we create a simple Google Analytics custom report.

  1. Go to the custom reporting section of Google Analtics
  2. Click to create a new custom report
  3. Name the report
  4. Add the top metric labeled Pageviews
  5. Add the dimension Page
  6. Save your report

Filter and Dashboard Your Report

Lastly, we're going to customize this report to show the most frequent article 'shares' on your dashboard.

  1. Open your newly created report
  2. Use the page filter at the bottom to show urls containing /share/ (don't foget to click Go)
  3. Click Add to Dashboard

Alas, we've been able to setup a set of goals that are important to our business decision making. We can now track how effective our blog is as a whole (how often do people share our content with each other) and also which of our blog posts are the most effective (which ones are the most viral so we can write more like them!) Now please, share this article with your friends so we can track it!

Tags: SEO, Web Development, General

RECENT POSTS
Best Practices for Digital Marketing in 2022: FREE GUIDE