Your marketer sent an email yesterday night:
“I have a new email campaign going out and want to track the performance of these email in terms of how they drive visits and conversion on the website.
My needs are as follows:
- I need to know which links users clicked in the email
- What did they do on the website
- If possible I want a conversion funnel for email journeys
- It would be great if you can also tell me how I can get this tracking in place for all my email campaigns going forward.
Thanks
Sarosh, your friendly colleague in marketing.”
So what now?
Campaign Tracking
Luckily, campaign tracking is a pretty standard thing to do in any analytics package. Adobe Analytics is no exception.
In the web analytics world we call something a “campaign” if it
- is off-site (not on our own web site)
- has been paid somehow (either directly, per click, per email sent, or because we’re paying someone to tweet)
- has links bringing visitors to our site
Campaigns come in all sorts of shapes and sizes. Emails sent out to prospects or customers are campaigns. Our paid keywords on Google or Bing are campaigns. Those banners we’re placing all over the known Internet are campaigns. Even our tweets and Facebook postings are campaigns!
So how do we measure them?
The crucial part is the 3rd item above, the link that brings people to our site. We cannot rely on the HTTP Referer (sic) header, because often people come from apps and there is none.
So, we ask the marketers to assign “campaign IDs” or “tracking codes” to their campaigns. They are supposed to place those tracking codes on every link that they distribute, be it in an email or on twitter.
Now when a visitor clicks on the link, all we have to do is to detect that tracking code in the URL, pull it out and send it into the analytics system.
Let’s look at the details.
Tracking Codes
This is the easy part, from a technical perspective. All the marketers have to do is make sure every link they post or send anywhere in the Internet has a tracking code on it.
Usually, the code would be in a URL parameter named ‘cid’, ‘cmpid’ or ‘extcam’ or something similar. An example link to this posting might look like this:
https://webanalyticsfordevelopers.com/2013/03/26/email-tracking/?cid=1303selfreflink
The tracking code would be “1303selfreflink”.
Easy.
Some notes:
- Tracking codes should probably be relatively short. We don’t want to run into the 2048 byte URL length limit on older IEs.
- A tracking code should be specific, either to the email sent, banner placed or keyword bought, or a level deeper: specific for each link in an email. The more specific it is the more insight the marketer can gain, if they use that data. Don’t worry about having too many tracking codes. There’s a tool called SAINT which will allow you (or your marketer) to aggregate.
- It makes a lot of sense to agree on a structure for the tracking codes! Coding things like date (“1303”), distribution channel (“eml”, “ppc”, …) or even the name of the person responsible is a good idea! “eml1303jenewmerch01” could be the first link in an email about new merchandise that I sent via email in March 2013. Again, SAINT helps turning those tracking codes into readable campaign names.
- Use SAINT!
Sending the Code into the Analytics System
Now this is where your skills come into play.
We can do this two ways: a) put JS code on eveyr landing page that looks for the ‘cid’ parameter and reads the code, or b) do it in a central place somewhere.
Once the code has been read from the URL, it needs to go into a special variable that Adobe Analytics provides specifically for campaign tracking: s.campaign
.
Being an (ex-) programmer, I definitely prefer option b, of course. We’ll explain how this works exactly, but for now it’s enough to know that you can use a “plugin” in the s_code.js
file. The code looks like this:
s.campaign=s.getQueryParam('cid');
s.campaign=s.getValOnce(s.campaign,'s_cmp',0);
The first line tries to read the ‘cid’ parameter from the URL.
The second line uses another plugin to deduplicate, meaning if within the current Visit we have seen this tracking code, we won’t send it into the analytics system again. Most marketers prefer it this way.
We won’t go into the difference between “traffic variables” and “conversion variables” at this point, but just so you know: s.campaign
is a conversion variable, a bit like a persistent tag tied to the visitor.
With the tracking code sent into Adobe Analytics, the marketer can now answer all the questions they raised in their email above. They can segment by a tracking code or a campaign. They can look at funnels based on the campaign, and they can even find out which link worked best if they assigned individual tracking codes to all the links in the email.
Next week we’ll post a series of articles about the s_code.js
file.
20 thoughts on “Email Tracking”