Omniture plug-in: “setCampaignVars” for efficient campaign tracking

Today, I’m proud to share a plug-in that will help to make campaign tracking more efficient within Omniture’s s_code.js file 1. It’s called setCampaignVars. It’s free, it’s easy to use, and — best of all — it’s open source.

Background: Campaign Tracking with Omniture SiteCatalyst
At its simplest level, campaign tracking works this way: the Omniture code reads a value from the URL and saves it as your campaign tracking code. For example, let’s say that I have the following URL:

http://www.my-wonderful-site.com/index.html?cmp=foobar

The Omniture code can be configured to get the campaign tracking code whenever it sees the “cmp” query parameter in the URL. In this example, it will save foobar as the tracking code.

But Omniture recommends that campaign tracking doesn’t stop there. It suggests the following:

  • Store the tracking code in an Omniture traffic variable - to report on pageviews, visits, time spent, and similar metrics
  • Store the tracking code with your landing page name and enable pathing on this combination - to track how users navigate your site from the landing page

In addition, depending on your requirements, you might also need to

  • Make the user’s browser retain the tracking code for a period of time 2, regardless of how he subsequently returns to your site.

Campaign Tracking introduces New Problems
To implement the above, your Omniture technical account manager should have provided you with a set of code that you can just copy-and-paste into your s_code.js file, or the file may already contain the code when it was first given to you. That’s all well and good. BUT (and you knew there would be a “but”), that code normally applies for external campaigns only, for example, to track users who enter your site from a paid search campaign.

On the other hand, you may have internal campaigns, e.g. banners within your site, like on your homepage, for certain promotions. You’d want to track these in the same way as external campaigns. (Omniture recommends that you do so too.) But that means you’d have to (a) write the code yourself, or (b) get your account manager (or savvy web developer) to do it for you.

New Problems demand a New Solution: setCampaignVars
Now I give you option (c): setCampaignVars. After adding the plug-in to your s_code.js file, you will be able to:

  1. Get the (external or internal) campaign tracking code from your URL
  2. Store the tracking code in both traffic and conversion variables
  3. Store the tracking code+landing page combo as a traffic variable for pathing (optional), and
  4. Retain the tracking code only once for a certain period of time (optional)

Here’s how to use setCampaignVars:

  1. Get the file, setCampaignVars.txt
    • Refer to setCampaignVars_maximized.txt for the plug-in’s details and its “maximized” version
  2. Copy-and-paste the contents of setCampaignVars.txt into your s_code.js after “PLUGINS SECTION”
  3. Make sure your s_code.js contains Omniture’s getQueryParam, getAndPersistValue and getValOnce plug-ins
  4. Use setCampaignVars within the s_doPlugins block

Getting Started with setCampaignVars
Here are a few example scenarios to get you started with step 4:

  • Save your external campaign tracking code (from the “cmp” URL query) to s.campaign and s.prop1, and expire the tracking code within the same visit
    s.setCampaignVars('cmp','campaign','prop1');
  • Save your external campaign tracking code (from the “cmp” URL query) to s.campaign and s.prop1, keep the tracking code for up to 7 days, and enable campaign pathing (using “:” to separate the tracking code from your landing page name) on s.prop2
    s.setCampaignVars('cmp','campaign','prop1',7,'prop2',':',s.pageName,true);
  • Save your internal campaign tracking code (from the “intcmp” URL query) to s.eVar7 and s.prop7 and retain the code for the next 30 days
    s.setCampaignVars('intcmp','eVar7','prop7',30,,,,true);

Now It’s Your Turn
I’ve used setCampaignVars with great success for a major project. Knowing that it works properly in a production environment, I’m now making it publicly available for the Omniture community to use as well. Hopefully, it makes your lives much simpler, as it did mine.

If you encounter any implementation errors with setCampaignVars, please log it down at the setCampaignVars support section in SourceForge. Or help me fix it 3.

Disclaimer: setCampaignVars is not endorsed, verified or supported by Omniture. Use at your own risk. Also, by using this code, you agree not to hold XM Asia Pacific or any of its employees, both past and present, liable for any data errors and/or loss.

At XM, we’ve had a long and fruitful experience with Omniture, makers of a suite of analytics tools. This ranges from setting up a complete tracking solution to using its data to generate dashboards and reports. And this is our simple gesture of contributing back to the Omniture community.

Footnotes:

  1. The “s_code.js” file is a required JavaScript file that performs the guts of web tracking for Omniture’s tools.
  2. The retention period for your campaign tracking code is measured in days. Ideally, it should match your campaign variable’s setting within your report suite’s Administration section.
  3. setCampaignVars is entirely open source and licensed under the GNU General Public Licence v3.
Balasingam-Chow Yu HuiThis entry was written by Balasingam-Chow Yu Hui. He has worked as a Marketing Analyst at XM Asia Pacific since 2006.
You may remember him as author of “What is Web Analytics?” or from within the Singaporean social media circles. When he’s not working on Web Analytics, he can be found analysing the performance of his love life.

Posted by Balasingam-Chow Yu Hui

Its a Kickathon!

1-18-2010-11-07-17-am

OK our latest installment to Sony Football Asia – introducing the KICKATHON. Can you kick your way to South Africa? Well if you can there are some 2010 World Cup tickets in it for you – check it out here.

Posted by David Brown

Predicting the unpredictable

Wouldn’t it be great if we can one day predict the brand of car our customers will buy when they are at their peak, what brand of cornflakes they would eat every Sunday morning, when they will watch another 2012/Independence Day-type movie, right down to what gender of baby they are likely to have when they marry? “Predicting the unpredictable, quantifying the unquantifiable”, says Dogbert the guru*.  But before we are able to fully achieve that in the twilight years, lets see how we can predict the future with the pre-historical method of predictive analytics, summarized in eight easy steps (inspired by Dogbert).

1.) Use a previous campaign or a test as your base.

Say for example you need a conversion of 1000 respondents, and the industry/benchmark average is 2%, then we probably need a base of 50,000 to achieve your target or do an adequate test.

2.) Add geographic, demographic, psychographic & behavioural data to your base

Both the responders and the non-responders. Who wants to be known as Segment A when we can be described more adequately and be given a nice personality.

3.) Know what are all the possible ways (and the most effective way) of reaching your base

We do have mobile phones and a life in the social space.

4.) Test and Control

Divide your data into at least 2 groups everytime, equally. Test group carries the hypothesis, control group validates.

5.) Trash the anomalies

Don’t you hate it when you thought one of your content pillar is doing extremely well in terms of average time spent and when you deep dive into the data you realise that it’s some idiot who left the computer on with your website in the browser running throughout the lonely night? Discard the outliers, be it purchase patterns or web patterns.

6.) Design your modeling framework

We will usually start out with a typical multiple regression model before we move on the the more sophisticated models like CHAID etc. “A regression is an equation that describes the relationship between a dependent variable and more than one independant variable”.  Statistical definition of dependant variable connotes the action/consequence that will be influenced by how you set up the test environment, and indenpendant variable as the components that will not be influenced (e.g. demographic, geographic, behavioural data).

7.) Grade and weigh each variable and develop an algorithm

This step will help you in shortlisting the most important variables that will influence your results (e.g. income, age, family size, etc). One will probably need a PHD in statistics and a SAS or SPSS software to run a regression model and weigh the different variables, and to finally develop an algorithm ranking the deciles.

8.) Score the validation group

If the predicted results derived from the algorithm is a close match to your previous campaign/test, then  the algorithm developed will be useful to predict future campaigns. It should also help you identify the target segment more likely to respond to your campaign through the scoring exercise.

If all else fails, hire a consultant to do the work while you make yourself another cuppa! (*highly recommended)

Last but not least, meet Dogbert, the data guru.

http://www.theimprovegroup.com/weblog/dilbert070405.jpg

Posted by jolynnwong

5 New Technologies That Will Change Everything

thumbdrive1
An article on PC World: “3D TV, HTML5, video over Wi-Fi, superfast USB, and mobile “augmented reality” will emerge as breakthrough technologies in the next few years. Here’s a preview of what they do and how they work.” Read on.

Posted by David Brown

Rolighetsteorin.se, small ideas = big changes

A great campaign for VW in Europe. It really demonstrates the power of a rewarding interaction – something so powerful such as giving something first (in this case happiness), instead of a marketing message will often result in a change of behavior far more greater then expected.

Posted by David Brown

Who’s Driving Twitter’s Popularity? Not Teens

twitter-zoomed-out

From NY TIMES: Kristen Nagy, an 18-year-old from Sparta, N.J., sends and receives 500 text messages a day. But she never uses Twitter, even though it publishes similar snippets of conversations and observations.

“I just think it’s weird and I don’t feel like everyone needs to know what I’m doing every second of my life,” she said. Read more.

Posted by David Brown

HP TouchSmart Wins a double at New York Festivals

emo_wins_ny2

Congratulations to all the HP Touch team! We just pulled in two awards at the New York Festivals, a respectable Bronze and Silver. I will save you all our acceptance speech : ) Well done team, client and partners.

View the work: http://www.agency-showcase.com/hp_emo/hp_microsite.html

Posted by David Brown

[Career] Marketing analyst

  • Do you like looking at numbers?
  • Do you think that you understand human behaviour?
  • Do you keep up with the latest technological and marketing trends?

If your answer to the above three questions is a resounding “YES!”, then we have a job for you! XM Asia Pacific is hiring a marketing analyst for the Planning and Analytics department. We are looking for someone who can derive meaningful understanding of how people interacted and behaved with our digital campaigns.
Read the rest of this entry »

Posted by Balasingam-Chow Yu Hui

Online Infocomm Directory for SME

Infocomm Development Authority (IDA) of Singapore continuous effort to help small and medium enterprises (SME) to move up the value chain through technology adoption and advancing in the digital world. The following PDF provide details on how SME can benefit from the various affordable infocomm packages.

If you runs a SME, clieck here to find out more.

Posted by Vince Lui

7 minutes to reinvent the internet - Ty Montague Chief Creative Officer, Co-President, JWT North America

Posted by David Brown