Upcoming LunaMetrics Seminars
Seattle, Nov 3-7 New York City, Nov 17-21 Washington DC, Dec 1-5 Los Angeles - Anaheim, Dec 8-12

Author Archive

Content Experiments JavaScript API

Caution - Test in ProgressGoogle Analytics Content Experiments are a great way to quickly and easily set up simple A/B tests for your website. And for most people, setting up these experiments can be done using the interface in Google Analytics.

However, there are some who desire a little more control over the variation pages, that just can’t be done through the setup wizard.

For example, when you’re choosing you’re variation pages, you can specify full (exact) URLs for the variations, or relative URLs. If you choose to specify the variations by the full URL, you’d end up with something like:

Original Page:


Variation 1:


Variation 2:



If you choose relative URLs, you can take advantage of query parameters to specify your variations. This makes it possible to do site-wide tests, by placing the Content Experiment code on every “original” page of the site. Then, for your variation URLs, you’d have:

Google Analytics Campaign Tagging Tool

Want to know the ROI of your email marketing? What about the performance of your print ads? Are your posts to Facebook leading to conversions on your site?

Tagging your marketing campaigns is essential to get these actionable insights from Google Analytics. But you might have more than one person responsible for all of your marketing initiatives (imagine that!). You might have teams of marketers and content writers who all dip their hands in the the campaign cookie jar from time to time. That’s great! If you’ve gotten to the point where your non-web analyst peers are tagging their URLs with campaign parameters, you’ve already overcome the biggest hurdle. Now, if only you could get them all to use the same naming conventions… (more…)

Deleting Goals in Google Analytics

Have you ever set up a goal in Google Analytics, and later wanted to delete the goal from your profile? You go into the Admin section, click into the Goals tab for the profile, and search for the “delete” button. But you don’t find it.

That’s because it doesn’t exist.

This is a common question that’s been asked before, and it recently came up at our Google Analytics training last week.


In Google Analytics, you have four sets of goals, each with five goal slots available. Hence, you can create a total of 20 goals per profile.

Goal sets in Google Analtyics

Goals let you define success for your website. You tell Google Analytics what you want people to do on your site, and when they do it, it counts as a goal. You can even tell Google Analytics how valuable the goal is to you. (more…)

Google Analytics Metrics and Dimensions

Dimensions and metrics are the building blocks of your reports in Google Analytics, but so often I see confusion about the difference between dimensions and metrics. And even when you have a fair understanding of what dimensions and metrics are, you may not realize how many of them you actually have to choose from.

There are more than 230 (!) metrics and dimensions you can choose from when you’re creating a custom report or advanced segment. I’ve created a simple spreadsheet that should help expose the many options you have. You can download it now, but before I talk about that, let’s get everyone up to speed on the basics.

Dimensions describe the data. They are the labels in the rows of your reports. Think of a dimension as describing the “what,” as in “what keyword did they use” or “what city is the visitor from” or “what pages were viewed.”

Metrics measure the data. Metrics are elements about a dimension that can be measured. Think of a metric as answering “how many” or “how long,” as in “how many visits” or “how long a visitor was on the site.”

Download the Metric & Dimension Guide

Now, back to those 230+ metrics and dimensions. The spreadsheet organizes them into two tabs – Dimensions and Metrics (big surprise!).

For each dimension/metric, it lists the name and definition. It also tells you what type of data is being measured or described (visitor, page tracking, AdWords, etc.). I’ve also included the API reference for each metric/dimension that is available via the Google Analytics Reporting API.

There’s also a column labeled Where You’ll Find Them, which tells you how they are (unfortunately) categorized within the custom report and custom segment creation interfaces. For example, if you’re looking for the User Defined Value dimension, it’s located under Content (instead of Visitors, where it belongs). Looking for the % Exit metric, check under Visitors (instead of Content). You get the idea.

Now it’s your turn

Still confused about dimensions and metrics? Wondering about some of those odd metrics, like TV Impressions are? Ask us below!


How To Track Form Abandonment in Google Analytics

A question I hear frequently is “can I track form abandonment in Google Analytics?” The answer is yes, and I’ll explore the details in a moment, but you should first consider alternative solutions.

There are existing solutions (like ClickTale) that do this in a much more elegant manner, with reports dedicated specifically to form analytics. Think of it like the goal funnel visualization reports, but applied to forms.

However, if you don’t want to spend the money on an alternative solution, or you want to keep everything in one place (i.e., Google Analytics), I can help you.

Tracking forms with events

You can use event tracking to find out which fields of your form are being filled out, and which ones are causing people problems. To do this, you can fire an event whenever a user’s cursor exists a field of the form. The easiest way to do this is with a script like below:

Owned vs. Earned Social Media Traffic in Google Analytics

You just haven't earned it yet babyToday I’m going to show you how to measure your owned social media traffic and your earned social media traffic. First, some definitions:

Owned Social Traffic – a visitor that comes to your site by clicking on a link that YOU shared on a social platform (Facebook, Twitter, etc.)

Earned Social Traffic – a visitor that comes to your site by clicking on a link that someone else has shared on a social platform

Here’s a quick guide on defining paid, owned and earned media that is applicable to what I’ll be talking about.

Tag, you’re it

To be able to measure owned vs. earned, you need to do something special to the links YOU share. You need to tag them with some extra information. So instead of sharing this:


You add some campaign parameters (in a way that Google Analytics recognizes) to indicate the source, medium and campaign. So you end up with one very long URL like below (which we’ll deal with in a moment):


Sources and mediums and campaigns, oh my!

For the utm_source, this is the social network on which you’re sharing the link. So if you’re sharing the link on Twitter, the source is twitter. It’s important to be consistent. These parameters are case sensative – Google Analytics makes a distinction between Twitter (with a capital T) and twitter (lowercase t). If you’re not consistent, you wont be able to easily roll up all of your data from each source into one report.

For the utm_medium, this should be social.

And for the utm_campaign, indicate either a marketing campaign that the tweet is part of, or the type of content you’re sharing. For example, blog posts are often commonly tweeted or posted to Facebook when they’re published, but it’s not necessarily part of a marketing campaign. For tweets with links to blog posts, consider using blog as the campaign.


Once you’ve added those campaign parameters to the URL, you’ll need to shorten it for 2 reasons:

1. So it doesn’t take up precious characters (in the example above, you’d only have 44 characters left for the actual tweet!)

2. So it doesn’t look so ugly. Purely aesthetic.

Bit.ly is a great tool to shorten links (my favorite) and there are many other options out there, like Google’s URL shortener (goo.gl) and ow.ly.

Of course, if you’re doing a lot of sharing on a lot of networks, you won’t want to manually create a unique shortened link for each piece of content that you’re sharing on each social site. That would get tedious and time consuming. Fortunately, I’ve built a tool to do this for you. All you have to do is enter the URL you’re sharing and it automatically creates the shortened links to share on Twitter, Facebook, Google+ and LinkedIn.

You can get that tool here, or read more about how it works on the Tracking Social Media with Google Spreadsheets post.

Reporting owned vs. earned

Once you get in the habit of tagging your own shared social links, you’ll be able to segment them in Google Analytics using Custom Segments. In a second, I’ll share the custom segments with you to do this. Then you can apply those custom segments to your Social Sources report, like below:

Owned vs. Earned Social Media Traffic

This graph shows visits to the site from owned social media in orange, and visits that resulted from other people sharing our content – earned social traffic – in blue. Below the graph we get the breakdown of owned vs. earned for each social source:

Owned vs. Earned Social Media Traffic

This is a great way to begin doing some correlative research to see how your sharing impacts not only traffic to your site, but other people’s sharing of your content.

Here are links to the custom segments. Keep in mind, these will only make sense in the context of the Social Reports, and you have to tag your links to make these work.

Owned Social Traffic

Earned Social Traffic

Check, check, is this thing on

Is this something you care about? Are there other areas of measuring social media that’s you’re more concerned with? Let me know in the comments!


Troubleshooting with Real Time Reports

It’s been about a year since Google Analytics launched Real Time reports. At first, they were cool to look at but provided seemingly limited functionality and actionable insights. One of the few examples of usefulness was measuring the immediate impact to your site from social media activities.

Real Time Reports in Google Analytics

But lately, I’ve been turning to Real Time reports for a different use: research and troubleshooting. There is one area in particular that you can use Real Time reports to help with (more…)

Introducing Google Tag Manager

Have you ever needed to make a tiny change to your Google Analytics tracking code, but your IT team told you it would be 6 weeks until the next code refresh? What if you could just log into a tool, make the change, and have it go live immediately – without IT involvement? Now you can.

Google Tag Manager

Google announced the launch of Google Tag Manager this morning at the eMetrics conference in Boston. Google Tag Manager (GTM) is a free tool that lets you manage the marketing and measurement tags for your web site in one place. This means no more scattering scripts across your pages and waiting on IT to track them down.


Direct Visits in Google Analytics – A Wolf in Sheep’s Clothing

Sometimes direct is good. For example, I would have much rather been on a direct flight to Denver for this week’s Google Analytics training than having a layover in Charlotte.

But not everything direct is good. Take visits to your website, for instance. Direct visits are the worst visits you can have (at least from the perspective of a web analyst).

Why, you ask? Because direct visits are a mystery. We don’t know why they came to our site, how they found out about us or whether our marketing and advertising worked.

When you have referral or campaign information about the visits to your site, you can start to see which marketing initiatves are working and which ones you should dump.

Here’s the problem: even with rock solid campaign tagging, you’re still going to get Direct visits. Even worse, the number of those visits that aren’t truly Direct is on the rise.

Let me say that again. Not all of the “Direct” visits to your site are Direct. We have a wolf in sheep’s clothing here.

I don’t see a lot of people talking about this issue (at least publicly) but I expect it to become one of the most important issues in the web analytics industry in the next year or two.

First, let’s look at where these wolves are coming from, then talk about ways to rip off their disguises.

Mobile Devices and Apps

Let’s face it, we’re living in a multi-device world, where people connect with your content not just from a computer, but from their phones and tablets too. And they don’t always use a web browser to pull up your site. They click on links within apps for Twitter, Facebook, Pinterest, LinkedIn and many, many more.

Many of these visits show up as Direct.


Clicks on (untagged) links within Outlook and other desktop email clients show up as Direct. That’s always been the case. But what’s become more common is for web-based email clients (Gmail, Yahoo! Mail, etc.) to use secure browsing (https). Consider your referrer lost – “Direct” visits strike again, more wolves.

Twitter Clients

Tweetdeck and other non-mobile Twitter apps can also show up as Direct, if a link shortener is used (bit.ly or goo.gl, for example).

Instant Messangers

How often do you send a link to someone in Google Talk or Skype? If they click on it, they are a “Direct” visit.

Technical Issues

Aside from things you have little to no control over, there are some causes that you an fix. For example, you may have errors in you code or conflicts with scripts that cause your visitors’ sessions and/or cookies to be reset, resulting in more false Direct visits.

What can you do?

The best way to clean up your data and identify these wolves is to tag them. This means having a stringent campaign tagging plan in place for every marketing effort your company does. Paid search, display ads, email marketing, TV, radio, print, direct mail, you name it – it can (and should!) be tagged. Try this campaign tagging worksheet to get started. It’s a Google Doc spreadsheet – just click File > Make a copy and it’s all yours. If the Make a copy link is grayed out, look at the link in the top right to make sure you’re signed in.

The other important thing is to realize that even that won’t solve 100% of the problem. Although you can use campaign tagging on everything you share, there will always be people who come to your site, like what they see, and copy/paste your URL into Facebook, Twitter, etc. This is especially true for blog posts and other informational content that is more likely to be shared.

One thing that will help is to look for patterns and trends in your data. As Direct visits increase, look for correlations between visits from social media (that you can still identify as such) and direct visits from mobile devices. This will be especially apparent if the direct visits are landing on internal pages with long URLs (that are mot likely not being typed in directly).

Your Turn

What weapons are you using to hunt down these wolves? How has this issue affected your data? The comments are yours!


Monitoring Penguin Updates with Google Analytics

penguins“You don’t want the next Penguin update,” according to Matt Cutts, head of Google’s webspam team. Those were his words less than a week ago at the keynote of the SES San Francisco conference.

Many SEOs and webmasters have been getting antsy over the impending update, which Cutts has said will be “jarring and jolting.” Although I won’t contribute to the millions of pixels that already dissect his statements, I will show you how to set up an early warning and monitoring station, using Google Analytics, of course.

How to use Google Analytics to monitor for Penguin updates

To monitor for updates from this flightless bird, we’ll be using 4 features of Google Analytics: 1) Custom Reports, 2) Dashboards, 3) Custom Segments and 4) Custom Alerts. Keep in mind, this will only let you know if you’ve been affected (positively or negatively) by Penguin. It won’t tell you when the Penguin update happened if it doesn’t affect your site.

1. Custom Reports

The standard way to check your organic traffic from Google in Google Analytics is this:

  1. Upon Logging into your account, you click Traffic Sources
  2. click Sources
  3. click Search
  4. click Organic
  5. choose Source as your Primary Dimension
  6. click google
  7. choose keyword as your secondary dimension
  8. use the advanced filter to exclude keyword exactly matching (not provided), click Apply

I don’t know about you, but that is far too many clicks and actions to get to data that I want to see on a regular basis. Fortunately, it’s easy to create a custom report that gives us the same data, but will only require two clicks to get to it.

Custom Report #1: Google Organic Search Traffic


Custom Report - Google Organic Search Traffic

 This report takes those eight steps above and gives it to you in two clicks. It shows you Google organic search traffic (excluding visits from users who are logged in to a Google account – those show up with (not provided) for the keyword).

It may also be helpful to see not just the overall visits from Google organic search, but to segment them by the number of words in the search queries. If Penguin targets specific keywords (as opposed to pages or sitewide adjustments) it may show up better this way.

Custom report #2: 1-Word Search Queries from Google

Custom report #3: 2-Word Search Queries from Google

Custom report #4: 3-5 Word Search Queries from Google

Custom report #5: 6-10 Word Search Queries from Google

Custom report #6: 11+ Word Search Queries from Google


Also, here’s a report that will show your top 10 pages from Google organic. By clicking on the page in the report, it will drill down into the keywords that were used to get to that page.

Custom report #7: Top 10 Landing Pages from Google Organic

Top 10 Landing Pages from Google Organic

2. Dashboards

Now, once you have those custom reports in place, you can package them all together into a one-stop Google organic dashboard. You can check in here daily to see any fluctuations or unusual activity coming from the big G.

Google Organic Dashboard

Here’s the dashboard, all ready for you to apply: Google Organic

3 & 4. Custom Segment & Custom Alerts

I know you’re busy. You don’t have time to check your analytics every single day, let alone obsess over every keyword. That’s where custom alerts come in.

Using a custom alert, you can be notified (by email or text message) whenever visits from Google organic decrease or increase by more than a given percent compared to the same day the previous week.

To do this, you’ll want to create custom advanced segments to match the custom reports above (include only Google organic visits, excluding (not provided) keyword). You could even go so far as to create a custom segment for each keyword length (I’ve done that for you below). This way, you’ll get an email if visits from Google organic where the searcher used between 3-5 words in their query decreases by more than 10%, for example.

Custom Segment #1: Google Organic Search Traffic

Custom Segment #2: 1-Word Search Queries (Google)

Custom Segment #3: 2-Word Search Queries (Google)

Custom Segment #4: 3-5 Word Search Queries (Google)

Custom Segment #5: 6-10 Word Search Queries (Google)

Custom Segment #6: 11+ Word Search Queries (Google)

Once you have your custom segments, go to your Admin settings (click Admin in the top right of the orange navigation bar). In the Assets tab, click on Custom Alerts, then Create new alert. Give your alert a name (e.g. 20% decrease in 2-word queries), then choose the period to be Day. This will make the comparisons on a daily basis (instead of weekly or monthly) and will alert you to any changes almost immediately.

Select the check box to send an email when the alert triggers. This will send an email to the address you use to log in to Google Analytics. If that’s not one you check regularly, you can also supply additional email addresses to receive the alert. And if that’s not enough, you can even set up your phone to receive a text message with the alert.

Under the Alert Conditions, select one of your custom segments from above for This applies toFor Alert me when, choose Visits, for the condition, and choose % decreases by more than and set a value. You may want to start out with something small, like 10%, then gradually increase if you find you are getting too many alerts that don’t reflect any actual changes. For Compared to, you’ll want to choose Same day in the previous week.

Set up a custom alert for each custom segment, to alert you to both increases and decreases in visits, and you’ll be on top of any changes in organic traffic from Google. This is good to have regardless of Pandas, Penguins, or any other black and white animals.

Bonus: While you’re setting up these custom alerts, do yourself a favor and set up these additional alerts.