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
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:
- Each of our 'share' urls begins with "/share/" so that we can roll them up later wioth goal tracking
- 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.
- Begin by going into the Goal Setup area of your Google Analytics account.
- Click Add Goal.
- Give your goal a description name, Article Shares
- 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.
- 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.
- Go to the custom reporting section of Google Analtics
- Click to create a new custom report
- Name the report
- Add the top metric labeled Pageviews
- Add the dimension Page
- 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.
- Open your newly created report
- Use the page filter at the bottom to show urls containing /share/ (don't foget to click Go)
- 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!