Category Archives: Basic

Source Tracking Part I: Default labeling and account linkages

Out of the box, Google Analytics source tracking is incomplete. Some sources – such as visitors that come to your site from offline sources – aren’t attributed meaningfully at all. Some other traffic sources, such as traffic from paid Yahoo/Bing search or non-Google online display ads come in with sloppy labeling.

First, I’ll go over some of the common sources of imperfection in Google’s source tracking, and then I’ll show you a few tricks you can use to make your tracking a lot cleaner.

Where (and why) Google Analytics default source tracking gets it wrong

Google’s source tracking is primarily URL based. When a visitor comes to your site, Google will look at the URL of the site they came from, and label the source of that visitor based on the referring URL. If the visitor came from a Google or Bing search listing, Google will see a URL that looks something like this:

http://www.bing.com/search?q=google+analytics&go=&qs=bs&form=QBLH

Google Analytics parses the URL to identify the following characteristics:

1. Source. The source is the domain name or publisher that brought the visitor to your site. This is equivalent to “WHO” led the visitor to your site. By default, Analytics records the domain name of the referring page as the “source”.

2. Medium. You can think of the medium as “HOW” the visitor found your site. Google looks for clues in the referring URL to identify whether the visitor came as a result of natural search, paid search, referral. If there’s no referring URL, the visit is labeled as a “direct” visit with a source of “none”. In the URL above, “search?” indicates that prior to visiting your site, the visitor made a search query. By default, Google labels this traffic as “organic search”. If Google recognizes the domain name of the referring site as a social network site, it will label the medium as “Social Media”. For all other referring URLs, Google records the medium as “Referral”.

3. Keyword. In addition to source and medium, which label the “who” and the “how” of a visitor’s source, Analytics can also parse the search term out of the referring URL to determine WHAT generated a visit. Someone who clicks on a search will provide a keyword (in above URL see the text after “q=”). This attribute is only relevant for visits generated by searches, and is applicable whether or not the visitor clicked on a paid search ad or organic search result.

You might have noticed by now that there are some major traffic sources missing in the descriptions above – namely any sort of online or offline advertising. This is because in GA’s model, these types of traffic look like other types of traffic. Someone that hears a radio ad might go directly to your site (direct traffic) or might search for your brand (paid or organic search, depending on what result is clicked). Someone that clicks on a display ad to get to your site might be labeled in one of a number of different ways, depending upon whether that display ad was served on a search listing page, social network or referring site. Even a click on a search ad, will not–by default–be distinguishable from a click on an organic search result because the referring URL takes the same form.

Needless to say, not being able to track advertising sources is a HUGE problem. Tracking advertising sources is critical to being able to identify how many visits and conversions particular ad buys are generating. Fortunately, there are a number of different solutions for setting up tracking for different types of advertising properties.

How to add tracking for Google Adwords

By default, your Google Analytics account will not recognize traffic generated by your Adwords account as paid advertising, and will instead identify it as organic search traffic. However, it’s really easy to link your Adwords and Analytics accounts. After linking your accounts, Analytics will properly label traffic with source=Google and medium=ppc and will also communicate a couple of additional attributes, specifically:

Campaign – the name of the Adwords campaign that generated the ad
Ad Content – the copy that the search ad displayed

Sounds useful, right? Here’s how you set up the link.

Click on the “Admin” tab in the top right of your Google Analytics screen.

Then, in the far left column under “Account Management”, click “Adwords Linking”.

adwords-linking-admin-menu

On the following screen, click “New link”.

adwords-linking-new-link

Then, select the Adwords account you want to link. Analytics should already recognize those Adwords properties for which you have Admin access. If you see a message that says that you do not have the permissions needed to link the desired Adwords account, you will need to either request Adwords Admin access, or else ask someone with Admin access to link the account for you.

adwords-linking-select-account

Once you have selected which Adwords account to link, then select which Analytics view to link to it to. Check the “Data Sharing” checkbox, if you would like to be able to view Analytics data from Adwords.

link-accounts

Do not be alarmed if you do not immediately see evidence of proper account linking. It may take up to 24 hours for the accounts to be properly synced and for you to begin seeing proper Adwords source tracking in Analytics.

So once you’ve linked your Adwords account, you will have proper source tracking for that advertising medium. You can also follow the same steps to link a Google AdSense account, if you have one. But what about other online display ads or offline advertising? Read more to learn how to use UTM parameters to fix advertising source tracking.

How to add Google Analytics to your site

Before you actually implement the Google Analytics tracking code, there are a couple of questions you should ask yourself first. You will need to decide which version of Google Analytics to use – standard or Universal Analytics – and you will need to identify how many different sites you need to track.

Standard vs. Universal Analytics

Google recently released Universal Analytics as the new official version of Google Analytics, and generally speaking, if you are adding Google Analytics tracking code to your site for the first time, I recommend that you implement Universal Analytics. That said, the standard version is still available.

Universal Analytics offers a number of exciting new features that are not available on standard, and as the official platform, will continue to benefit from new and updated features. (Stay tuned for a review of new features in Universal Analytics.) Although, as I said, in most cases I would recommend Universal Analytics, there are two main reasons why you might consider implementing standard if not instead of, than at least in addition to Universal. The first reason would be to take advantage of integration with AdSense, content experiments, DFA and remarketing, which exist in Classic and are not yet available in Universal. The other main situation in which you might want to use Classic would be if you had an existing older web site already using Classic, and wanted to implement Google Analytics on a newer web site you own and be able to have consistent implementation and reporting between the two properties. In either case, using Classic would not preclude you from using Universal as well.

What is a property and how many do you need?

At the very highest level in Google Analytics, you have Accounts. There is one account – i.e., person, company or organization – that owns the one or more sites being tracked. When you use Google Analytics, you place a unique cookie on each of the individual sites that your account (you or your organization) wants to track. One cookie pertains to one “property” in Google Analytics.

The most basic setup of a Google Analytics account would have one cookie on one website. However, there are cases in which your organization might want to have multiple websites tracked and even more than one cookie on a particular website. Most websites have a staging server. It’s a good idea to implement a separate cookie on staging so that you can test changes to your tracking implementation without risking interfering with the data for your production site. You would also create a separate property for any separate websites you own. Let’s say you own www.apples.com, and you also own www.bananas.com. Each site would get its own Google Analytics property.

To create a new property, login to Google Analytics or create an account, and then click Admin.

GA-admin-toolbar-screenshot

You should see a screen that’s divided into three columns, one column each for “account”, “property” and “profile”. To make sure you’re in the right place, look at the gray word or words above your account name (in the image below, “AnyaLamb”). If that gray word is simply “Administration”, you’re in the right place. If there are words following “Administration”, just click on the word “Administration” in the sequence to get back to the top level.

To create a new property, click on the pull-down menu immediately below the word “property” and select “Create new property”.

create-new-property

On the following page, select whether you would like to track a website or an app, select Universal or Classic.

select universal or standard analytics

Then enter your website name, URL, time zone, and industry. Click “Get Tracking ID”. Follow the instructions to place the tracking code on your website – usually in the header file.

enter-website-information

What is a profile and how many do you need?

A property represents a body of data collected about a site. A profile is a filter of that data that can then be reported upon. By default, Google Analytics will create an “All Web Site Data” profile for you when you create a property. You can, however, edit this profile and add other profiles.

The important thing to note about a profile, is that it does not affect data collection. Each particular profile is simply a lense with which to look at the body of data that is being collected on the property level. The profile settings don’t affect what data is or is not collected, they simply affect what that profile does or does not show you about that data. Furthermore, not only do different profiles within a property all refer to the same master dataset, they certain custom filters, such as advanced segments, that can be shared across profiles.

There are several really useful things you can do with filters that I’ve covered in previous blog posts, such as how to use filters to exclude internal traffic and use separate profiles to look at subdomains and subdirectories separately. Keep reading to learn more about filters!

The X and the Y: Dimensions and Metrics

Once, in elementary school, one of my teachers gave a very popular lesson on graphs using candy. She gave groups of us students bags of skittles and asked us to count how many of each color of skittle we had in our packets. On the chalkboard was a big empty X-Y axis. On the X axis was a list of all of the colors possible in a bag of skittles. We then had to mark an X above each color label on a plot for every skittle we had that matched that color label.

 skittles-graph

The X-axis, or the color of the skittle, was the dimension of the data – the attribute by which the teacher had us sort the “data” – i.e., skittles. The number of skittles of each color – that’s the metric. 

All of the reports you make in Google Analytics can be thought of in this same dimension vs. metric framework. You can save yourself a lot of trouble with imprecise reports by remembering to ask yourself what dimension and metric you’re interested in, and whether the metric makes sense for that dimension.

Let me show you some examples

Take a look at the default reports in Analytics. See if you can identify both the dimension and the metric.

Here’s the audience overview report – probably one of the most familiar reports in Analytics.

Visit Report

The metric is obvious – visits – but what’s the dimension? Time! Specifically, in this graph, the dimension is “day”. Although in dashboards you can change some graph orientations, by default, graphs in Analytics have the dimensions on the horizontal axis and the metric on the vertical axis.

Let’s look at something a bit more complicated. This is a source report.

Source Report

You can see the dimension on the left hand column of the table – the visit source. But what’s the metric? In this report there are actually multiple metrics. All of the columns besides the left hand column are metrics. This layout is also pretty consistent across Analytics – the dimension is in the left column, and any metrics are to the right.

Commonly-Used Metrics:

  • Unique Visitors
  • Visits
  • Pageviews
  • Goal Conversions

Commonly-Used Dimensions:

  • Geography (City, Metro, Region, Country)
  • Browser and Operating System
  • Device
  • Source and Medium

MacGyvering dimensions with advanced segments

If you haven’t checked out advanced segments yet, then oh my goodness, you really, really should. They’re awesome. I think my mind was kind of blown when I first discovered them. I basically thought they were the answer to everything. It turns out that they’re not (more on that in a future post), but they are pretty darn powerful.

So what are they? They’re basically a way to look at a specific subset of your data identified via certain criteria that you specify – across all of your reports. So you can say, “I want to look at all of the paid search visits in California that landed on this landing page”, and then look at that same group of visits across all of your reports and dashboards. But there’s something else that makes advanced segments even cooler – and relevant to this article.

You can look at multiple advanced segments at once – side by side! This means that you can set up your own “custom dimension” using advanced segments. There is a drawback though – Google Analytics only allows you to look at up to four advanced segments at once. I know, it’s a bummer.

Advanced Segments

Variations on Metrics – Calculated Metrics

A metric like “visits”, is simply a count that applies to a particular set of data. However, some metrics are more complicated than simple counts. Some metrics available in Google Analytics are calculated in order to show relationships between different metrics.

Average time on site, exit rate, conversion rate, bounce rate – all of these are examples of calculated metrics. Average time on site shows the relationship between the total amount of time spent on site and the total number of visits.

Sometimes calculated metrics go both ways

Although most attributes in Google Analytics are treated exclusively as either a dimension or a metric, some attributes may be metrics in some contexts, and dimensions in others. In every example I can think of, these are all calculated metrics (if you can think of a counter-example, go ahead and prove me wrong!)

Pageviews per Visit, Visits  per Visitor and Average time on Site can all be metrics (for dimensions such as source, geography, medium and device). However, you can also bucket visits, visitors and other metrics based upon the value of a different metric, as in the following chart which shows a volume of visits based upon the bucket of elapsed days since previous visit.

Days Since Last Visit

 

Stop Taking Selfies!

How to use filters to exclude internal traffic from reporting

Yes, you. Stop taking pictures of yourself. I know you might not mean to, but see, that picture there? Yeah, that one. We see your reflection in the window. Kind of ruins it.

What I’m talking about, is the problem of showing your own visits to your site in Google Analytics. Because let’s face it, compared to every other visitor of your site you and most other people that work on your site or at your company are weird stalkers with totally erratic, outlier behavior that shouldn’t be factoring into your web analytics.

This is super obvious if you’ve started a site by yourself. If you have, my experience with the first iteration of anyalamb.com might sound familiar.

The very first time I used Google Analytics was for the first iteration of this site about a year and a half ago. I had written a handful of posts and wanted to look in Google Analytics to see if they’d gotten any traffic. Unsurprisingly, they hadn’t gotten much – I saw several dozen visits from one user, and a handful of other uniques – mostly spam and close friends I’d send links to. I immediately realized that all or most of the returning visits must be mine. “There’s got to be some good way to filter this stuff out!”, I thought.

It turns out that there is a very quick and easy way to filter out your own traffic – and certain other types of traffic you might not want to include in your reporting.  Here’s how it works:

Filtering out an IP address

Click on “Admin” and then click on “Filters”. Name your filter so you can easily keep track of what you’re excluding from your Analytics reporting and why. For example, if you want to create a filter to exclude all IP addresses from your company headquarters, you might label it “Internal Widgets, Inc. IP Addresses”. If I want to exclude traffic from hy home IP address, I might name my filter “Anya’s home ip”.

filter out own traffic

To simply filter out individual IP addresses, you can leave “predefined filter” selected. Then “exclude” from the first dropdown menu and “IP address” from the second. Then simply fill in the IP address you want to exclude. It’s that easy.

(Don’t know your IP address? If you’re dealing with multiple IP addresses, you can ask IT directly. If you’re just trying to exclude the IP address you’re currently using, check www.whatismyip.com – and yes, you could have just googled that. )

Once you do this, traffic from this IP address will not appear on your google Analytics reports. And guess what? It works retro-actively too. Traffic from the filtered IP address will be excluded from reports even for dates prior to the implementation of the filter.

Why it’s important

Setting up filters is so quick and easy and obviously good for data quality that it doesn’t require much justification. But just in case you’re curious, here are a couple of other reasons I’m a fan of filtering out your internal traffic.

Now if you’ve got a lot of volume on your site, excluding your own visits might not seem very important – they might be a drop in the bucket and when you take a high-level look at things, they might not seem to interfere with your analytics very much. And this may very well be true – most of the time. However, those self-visits tend to be visible in high-profile places.

Say, for example, that you’ve created a new landing page and you’ve distributed it for internal review but haven’t started sending ad traffic to it yet. That page might garner a lot of “internal” traffic that might distort your analytics once the page actually starts receiving traffic.

It also might cause some confusion around when the page actually “launched”. If you filter out the internal traffic, you’ll only start reporting data for the page when the page actually starts receiving external traffic, and there will be a nice clear indication in your visit data of when that happened. Ideally, you’ll add an annotation to your Google Analytics timeline when that happens anyway, but just in case you forget, you’ll have an easy way to look it up.

What other IP addresses should you exclude?

Remember – yours might not be the only IP address you might want to filter out. Are there contractors that work on your site? Make sure you filter them out too. What about other office locations? Ditto. And of course, don’t forget to update your filters when you move offices or otherwise change or add internal IP addresses.

Don’t forget (friendly) bots!

If you’re intentially running a bot on your site, such as StillAlive, you’ll want to exclude it too, usually by IP address.

What if you’re using dynamic IP addresses?

That’s ok. You can still filter out internal traffic from dynamic IP addresses, but instead of using the IP address to filter, you will use a cookie. Lunametrics has a great post about how you can use cookies to label your internal traffic.

Learn about more cool things you can do with filters