• Jervis Koo

Tracking Campaigns In Google Analytics

Understanding how users get to your website can help with everything from marketing strategy, budgets for advertising, and content strategy. 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 implementing Google Analytics, like what pages are viewed or how someone reached your site. But there are also steps you can take to take these insights to the next level!

When someone visits your website, Google Analytics tries to figure out where that person comes from. It does this for each session and stores the data in the Acquisition -> All Traffic -> Source / Medium report (technically, the data is used in other areas as well, but this report focuses on these specific dimensions).

How Does It Work?

For most traffic coming to your site, Google Analytics looks at the page that the visitor was previously to determine which bucket of traffic they belong in. Google Analytics figures out where you've come from by using the “referrer” header, a special piece of data attached to a request for a page by the browser whenever a person visits that page from a previous page. Say for example I google "google analytics segment" and click on the first article.

When I do that, my browser attaches on the “referrer” header set to “https://www.google.com”.

When the page loads, my session begins, and Google Analytics determines that I must be coming from google / organic as my Source / Medium.

The referrer header (fun fact: “referer” you see on GA is a spelling error made from the early days of the internet!) is parsed by Google Analytics when the page loads on the first pageview of my visit (called a session in GA). It uses the data and categorises my visit to your site into one of three buckets:

(direct) / (none) (Direct traffic)

This is often referred to as “bookmark” or “brand” traffic, which in my opinion, is wrong. (direct) / (none) does not guarantee that someone typed in the URL directly; it just means Google Analytics does not know where they came from. In short, when they loaded their first pageview, the referrer header was empty.

example.com / referral

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

google / organic

Google Analytics has a default list of sites it considers search engines—including itself, Bing, Yahoo, DuckDuckGo etc. If the referrer header is from one of those sites, the session will be categorised as searchenginename / organic instead of as a referral.

Paid Traffic To Your Site

If you have enabled account integrations with Google Ads or DoubleClick Campaign Manager, the fourth type of traffic will be recorded is google / cpc, that includes sessions from visitors that clicked on your Search ads instead of organic results and got to your website that way.

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

Custom Campaign Parameters (UTM linking)

The previous buckets of traffic covered in the above section are determined automatically by Google Analytics when someone arrives on your website, using their previous page (the referrer) or special query parameters (paid search). These determinations can be useful but do not always provide you with enough information.

Campaign parameters a.k.a UTM parameters are special query parameters that are added to a URL in order to override Google Analytics default filters of where someone comes from. These are small pieces of info that we manually add to links before we add them a button or in a post before we share them. We use special words that Google Analytics is set up to recognise, which will then map to the fields in Google Analytics, like Source and Medium. If I was on jerviskoo.com and I clicked a link to a website example.com that looked like this:


Instead of seeing a session referred from jerviskoo.com / referral as the Source / Medium in Google Analytics, what you'll see is this;

Cool, right?!

How It Works

In the example above, I simply added the query parameters by typing them onto the end of the URL. You won't need to type these queries manually: 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.

There are social media and email campaign tools that will help do this for you automatically or allow you to add campaign parameters to outgoing emails or posts with just a little customisation. Those are great tools to serve as a reminder to tag your campaigns and to help you stay consistent across multiple platforms.

These custom parameters go on the link before you share it in your emails or place them on your website. 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?

Every business has a different way of categorising traffic. There's no right or wrong way, as long as it's been used consistently across your marketing campaigns. If you're looking for a place to start, check out this post on tips and tricks for naming conventions. 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 be using campaign parameters.

When you paste, post, or 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 your traffic into traffic you've generated versus traffic that has been acquired helps shape marketing priorities. For example, if we tag all the links that we share on Facebook, you can segment out traffic that came to your website through Facebook from traffic other marketing channels has generated, either through blog posts or different ads that were run. Without that distinction, we might attribute wins to certain marketing efforts that it wasn’t really responsible for.

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

Let's say you’re actively sharing links to the most recent blog posts or content 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 for those links on Google Analytics. For example, if the link was shared in an email you wrote to a client, your report will show client / email.

Extra Detail From Tagged Links

You can also take advantage of additional parameters to provide additional context in your reporting. Besides utm_source and utm_medium, there are also:

  • utm_campaign – used to store cross-channel campaign names so that all traffic can be rolled up and reported on. For example, if you run a monthly shoe promotion that you promote using search advertising, social advertising, and email marketing. If you add &utm_campaign=shoe-promo to all the links in each channel, when open the Acquisition -> Campaigns -> All Campaigns report on Google Analytics and find shoe-promo, you will be able to have a general overview of how many users and sessions the campaign acquired—all in one place!

  • utm_term – used for non-Google search engine ads to store the keyword you bid against, e.g “casual shoes”.

  • utm_content – used as a catch-all for any additional context you may want to collect from the link, e.g. “white shoe creative” or "model 1 wearing shoe"

Combating Direct Traffic

Traffic is frequently tagged (direct) / (none) when in reality, it's traffic coming to your website through a method that does not set a referrer header. A few examples:

  • Clicks from a link with a https: site that points to a http: site (for security reasons, the browser does not set a referrer header).

  • Opening a link from a native application (e.g. Outlook or Gmail or any other native apps).

  • Clicking a link that gets redirected multiple times and 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 almost certainly help with reducing the amount of Direct, or unknown traffic, by assigning appropriate traffic credit where possible. A consideration for when sending out emails campaigns – if someone opens the email in a native application like Outlook, and clicks on a link in the email, that will then open a new browser window and to load the page. In this example, there is no previous page, which means there is no referrer. Traffic will automatically show up in Google Analytics as Direct. Using Campaign Parameters will circumvent this!

With Campaign Parameters, you can define a source / medium for all of your outbound emails. For example using newsletter / email for your newsletters, adhoc / email for your ad-hoc emails etc. 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

When you tag your links and have set up either Goals or Ecommerce tracking, you will be able to see “last-touch” attribution for your marketing efforts in most of your reports. For example, in the Source / Medium report, the last three columns in the table will contain conversion data for users with that given source and medium. If you're a more advanced user, the Conversions -> Multi-Channel Funnels section of reports can be used to analyse behaviour 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 couple of important notes when using Campaign Parameters:

  • 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 the original context of the visit will be lost. Use Events or Enhanced Ecommerce Promotions.

  • GA is case-sensitive, so Jervis / Koo and jervis / koo will show up as two distinct rows. This is a common error that can lead to reporting errors, so make sure campaigns are tagged consistently. I would recommend using a tool like Google Sheets to keep tagging consistent. You can also use Filters to help avoid any mistakes.