Posted by KeithMacDonald

July 17, 2012


Leave Reply

Campaign Tracking in Google Analytics and SiteCatalyst

Every once in a while the question of managing campaign tracking in Google Analytics and SiteCatalyst comes up.  It raises both technical questions and governance questions.  We’ll come back to the governance part in a later post, this post will tackle the technical part.

Quick Review

Campaign tracking usually happens with campaign tracking codes or IDs inserted into the URL of the landing page.  In technical jargon:  campaign ID is a parameter in the query parameter string.  As example, tracking clicks to the page for Mergence (our SharePoint measurement product) might look like this:

Using Google Analytics, that same URL might look like this:

A user clicks through your ad (or Tweet, Facebook post, or types the web address on your subway poster), lands on the landing page, and the analytics tool captures the campaign ID from the URL.

The Problem

Establishing good campaign management practice is hard enough.  Having to worry about two analytics tools at the same time is harder still!

Often companies will use both Google and SiteCatalyst concurrently and want campaign tracking in both.  The question becomes about tagging for both SiteCatalyst and Google Analytics:  Can I capture Google tags or Google campaign tracking in SiteCatalyst?

The Solution

The standard solution for SiteCatalyst campaign tracking is the getQueryParam plugin in the s_code.js file.  Usually it’s configured like this:

s.campaign = s.getQueryParam('cid');

However, if you want to capture Google Analytics tracking codes in SiteCatalyst, getQueryParam can be set to look for multiple parameters and capture them in a delimited list:

s.campaign = s.getQueryParam('utm_source,utm_medium,utm_term,utm_content,utm_name','|');

That would return a value something like source|medium|term|content|name for s.campaign.

On its own its not terribly helpful, but you can classify those values with SAINT classifications to enable reporting like you’d see in Google.  Set up individual classifications for source, medium, term, content and name and each one will be available as a breakdown (sub-relation) or as a top-level report.

The Benefit

The benefit of capturing Google campaign IDs in SiteCatalyst is that your marketing team only has to tag once for both systems.  Chances are marketing, and the creative agencies they work with, are already familiar with Google campaign tracking parameters so you avoid causing confusion by adding SiteCatalyst tracking into the mix.  Marketing gets simple process, analytics gets campaign reporting in SiteCatalyst.  Everyone wins.
If you are using both a SiteCatalyst tracking IDs and Google IDs, you can use if statements to accommodate both:

if(!s.campaign) {

Google Auto-tagging Wrinkle

If you also use Google campaign auto-tagging, or use both auto-tagging and manual tagging, use another if statement to capture gclid:

if (!s.campaign) {
  if (!s.campaign) {

With this solution, you’ll still have to use SAINT classifications to match individual gclid codes with meaningful labels (source, medium, term, content, name).

Alternatively, you can combine them all into a single line, however you will likely run into trouble if more than one are present (e.g. if you have both cid and utm_ parameters).

  • Angel Smith says:

    Thank you for this helpful article. I often recommend Taglynx for campaign tagging since it creates and checks the tags for you. It also provides short links with click data. Try it out:

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    Explore Posts By Category



    Want to know more?

    Contact us