Tracking Inbound Campaigns in Google Analytics

/

Campaigns in Google Analytics

Understanding how users get to your website can help with everything from marketing strategy, advertising budgeting, and even content production. It’s also one of the most popular reasons to use Google Analytics. There are certain things that you get out of the box with a Google Analytics implementation, like what pages are viewed or how someone reached your site. There are also steps you can take to improve these reports!

Normally, when I visit your site, Google Analytics tries to figure out where I’ve come from. It does this for each session and stores the data in the Acquisition -> All Traffic -> Source / Medium report (technically the data is used all over the place, but this report focuses on these dimensions).

How Does It Work?

For most traffic coming to your site, Google Analytics looks at the page that I was previously to determine which bucket of traffic I belong in. Google Analytics figures out where I’ve come from by using the “referrer” header, a special piece of data attached to a request for a page by the browser whenever I travel to that page from a previous page, e.g.:

1) I google “google analytics training”

2) I click the link to the LunaMetrics site; when I do that, the browser tacks on the “referrer” header set to “https://www.google.com”

3) The page loads, my visit begins, and Google Analytics determines that I must be coming from google / organic as my source and medium.

The referrer header (spelled “referer” in the wild thanks to an early spelling error) is parsed by Google Analytics when the page loads on the first pageview of my visit (called a session in GA parlance). It uses the data there to try and categorize my visit to your site into one of three buckets:

(direct) / (none) (Direct traffic)

Often this is referred to as “bookmark” or “brand” traffic, which is wrong. (direct) / (none) does not guarantee that someone typed in the URL directly (a square is a rectangle but a rectangle isn’t necessarily a square); it just means we don’t know where they came from. In short, when they loaded their first pageview, the referrer header was empty. We’ve got more details about direct traffic misconceptions in another post.

othersite.com / referral

This is called “referral” traffic, and it includes any session that began when a user clicked a link from another website (e.g. example.com has a link that points to lunametrics.com).

google / organic

Google Analytics has a special list of sites it considers search engines (including itself, Bing, Baidu, etc). If the referrer header is from one of those sites, my session will be categorized as searchenginename / organic instead of as a referral.

Paid Traffic To Your Site

If you enable account integrations with Google AdWords or DoubleClick Campaign Manager, a fourth type of traffic will be recorded – google / cpc, which will include sessions that clicked on AdWords ads instead of organic results and traveled to your site that way.

Similarly, if you’ve integrated with DoubleClick Campaign Manager, you’ll see – dfa / cpm, showing sessions that came to you via an advertisement that they interacted with.

Custom Campaign Parameters

Now here comes the fun part! Those previous buckets of traffic are determined automatically when someone arrives on your website, using their previous page (the referrer) or special query parameters (paid search). These determinations can be useful, but don’t necessarily provide a lot of information.

Campaign parameters (a.k.a. UTM parameters, campaign tags, ad nauseam) are special query parameters that are appended to a URL in order to override Google Analytics default detection of where someone comes from. These are small pieces of info that we manually add to a link before we share them. We use special words that Google Analytics is set up to recognize, which will then map to the fields in Google Analytics, like source and medium.

If I was on lunametric.com and I clicked a link to your site that looked like this:

http://www.example.com/?utm_source=Marlon&utm_medium=Brando

Instead of seeing a session referred from lunametrics.com / referral in Google Analytics, you’ll see:

Marlon / Brando

Weird, right?

How It Works

In my example above, I simply added the query parameters by typing them onto the end of the URL. You don’t need to implement these by hand: Google makes available a simple tool called URL builder that does the hard work – you just give it a URL and your desired source, medium, and so on.

Certain social media and email campaign tools will help do this for you automatically, or allow you to add campaign parameters to all outgoing emails or post with just a little customization. Those are great to help ensure consistency and make sure you don’t forget!

We’ve written about a few other options before – we love using Google Sheet to keep everyone organized in your company. Here’s a Google Sheets template we put together a few years ago.

These custom parameters go on the link before you share it or email it out. Then, when a person clicks on that link and arrives on your page, Google Analytics takes care of the rest – using those values to override the default automatic traffic naming.

How Do I Choose What To Add?

We’ve also written extensively about how to choose what to call your traffic sources. Check out naming convention post for ideas and tips. In general, there are few standards (like medium = email) that you can follow, but it should make sense to you and your team.

Unlimited Potential

​Campaign Parameters give you the ability to define how Google Analytics classifies a given session. In general, when we’re sharing a link that we have control over (for example, in an email newsletter), we should use campaign parameters.

Let’s repeat that – when you paste/post/share a link on another site in an effort to drive traffic to your own site, you should use campaign parameters.

Taking Credit for Our Efforts

Separating our traffic into traffic we’ve generated versus traffic we’ve just happened to acquire helps shape marketing priorities. For example, if we tag all the links that we share on Facebook, we can segment out traffic that stumbled onto our site through Facebook from traffic our marketing has earned, either through posts we published or ads that we ran. Without that distinction, we might attribute wins to our social media marketing that it wasn’t really responsible for (and vice versa).

Traffic from Facebook by itself might be lumped into facebook.com / referral. Sometimes you’ll also see m.facebook.com or l.facebook.com.

Now let’s say you’re actively sharing links to your most recent blog posts from your company page, and you’ve tagged those with custom campaign parameters. Now, we’ll ALSO see traffic coming in from the source and medium that you’ve defined, perhaps something like facebook / social.

Extra Detail From Tagged Links

Take advantage of additional parameters to store extra context; I showed you utm_source and utm_medium, but there’s also:

utm_campaign – used to store cross-channel campaign names so that all traffic can be rolled up and reported on. For example, you run a quarterly sales event that you promote using display advertising, social advertising, and email marketing. If you add &utm_campaign=quarterly-promo to all the links in each channel, you can open the Acquisition -> Campaigns -> All Campaigns report and find quarterly-promo, where you’ll be able to see in one place how many users and sessions the campaign acquired.

utm_term – Used for non-Google search engine ads to store the keyword you bid against, e.g “google analytics training”.

utm_content – a catch-all for additional context you may wish to catch about the link, e.g. “boy laughing creative”

Combating Direct Traffic

Traffic is very frequently tagged (direct) / (none) when in actuality it is traffic coming to the site through a method that does not set a referrer header. A few examples:

  • Clicking a link on a https: site that points to an http: site (for security reasons, the browser does not set a referrer header).
  • Opening a link from a native application (e.g. Outlook or a native app).
  • Clicking a link that is redirected many times where the referrer header is either lost or set to the “wrong” referrer

You won’t always be able to combat these issues, however using Campaign Parameters will definitely help reduce the amount of Direct, or unknown traffic, by taking credit when possible. Consider sending out emails to your email list – if someone opens that email in a native application like Outlook, that will then open a new browser window and load the right page. In this example, there is no previous page, which means there’s no referrer, which means it will automatically show up in Google Analytics as Direct.

With Campaign Parameters, you can define a source / medium for all of your outbound emails, something like newsletter / email. Now, regardless of what email provider a recipient is using, if they click on that link – they’ll show up in your reports correctly.

Going Forward

Once you’ve tagged your link, if you’ve set up either Goals or Ecommerce tracking, you’ll be able to see “last-touch” attribution for your marketing efforts in most of your reports; for example, in the Source / Medium report, the final three columns in the table will contain conversion data for users with that given source and medium. When you get to be a more advanced user, the Conversions -> Multi-Channel Funnels section of reports can be used to analyze behavior over many sessions (e.g. did any users hear about us from that email and then come back a few weeks later and convert).

A few important warnings:

  • Never tag internal links with campaign parameters (e.g. from your homepage to a sale page). This will cause a second session to be started for the user and will destroy the original context of their visit. Use Events or Enhanced Ecommerce Promotions.
  • GA is case-sensitive, so Marlon / Brando and marlon / brando will show up as two distinct rows. That can lead to reporting errors, so make sure everyone is on the same page. We recommend using a tool like Google Sheets to organize everyone. Additionally, Filters can be used to help avoid any mistakes.

Dan Wilkerson is a Software Engineer at LunaMetrics. Though really a Palmyra, PA expat, Dan insists he's a "non-native" 'Burgher. Approaching social early, then marketing, exigencies of native targeting soon entangled him in numbers. Dan is happy to have ended up living in Pittsburgh and (accidentally) as a self-taught and avid programmer.

  • I won’t always be able to combat these issues,

  • Keyonda Noel

    Based on your tip: ” Never tag internal links with campaign parameters,” how would you handle the following. On the thank you page for our sports medicine campaign, I added a link to the main website so that consumers can learn more about the program if they want. I put a utm on that link, but that I think it breaks your rule. On the same page, I linked a banner to the main website and included a utm. If this is wrong, what should we do? Why would it be considered two sessions?

Contact Us.

LunaMetrics

24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us

1.877.220.LUNA

1.412.381.5500

getinfo@lunametrics.com

Questions?
We'll get back to you
in ONE business day.