Nine times out of ten if I’m pulling a parameter out of the query string, it has something to do with campaign tracking.
s.campaign = s.getQueryParam('cid');
However, when automating your measurement implementation, there is often a wealth of information that can be pulled from the query string. If you are making use of the Omniture ‘getQueryParam’ plugin, remember (I had forgotten) that the plugin can be used to pull query string values out of strings other than the current URL.
Just the other day, I was addressing a requirement to track interaction with social media bookmark buttons supplied by AddThis.com
![]()
I needed to capture which social media service was being used and what page was being bookmarked. I was able to make use of getQueryParam along with the linkHandler plugin to get everything I needed.
Example exit link:
http://www.addthis.com/bookmark.php?&s=facebook&title=i%20can%20has%20cheezburger
Output:
s.eVar1 = “facebook”;
s.eVar2 = “i can has cheezburger”;
var url=s.linkHandler("Social Media~addthis.com","e");
if(url){
s.events=s.apl(s.events,"event1",",",2);
s.eVar1=s.getQueryParam('s','',url);
s.eVar2=s.getQueryParam('title','',url);
//Track eVar & Event
s.linkTrackVars="eVar1,eVar2,events";
s.linkTrackEvents="event1";
}
1. I used s.linkHandler to capture exit links for the URL ‘addthis.com’
2. event1 denoted a ‘social bookmark’ event
3. In the exit link URL ‘s’ is the social network being utilized and ‘title’ is the page being bookmarked.
4. I used s.getQueryParam to pull the query string values from the exit link captured by s.linkHandler (notice the 3rd argument, I passed in the URL string generated by the linkHandler plug-in).
Lesson Learned: Query parameters have more uses than just campaign tracking!
Bonus Code:
A friend of mine was working on a issue where a client needed to pull multiple campaign tracking codes, all with the same parameter name, from the query string and concatenate them together. In this case, there were N number of times that ‘cid’ could appear within the query string. I have no idea what the business case was, although now I’m very interested, but here is the code that will solve the problem.
Example link:
http://www.site.com?cid=value1&cid=value2&cid=value3
Output:
s.campaign = “value1:value2:value3″;
for (var i=0;i
if (pair[0] == variable) {
j = j + 1;
if (j == 1){
s.campaign=pair[1];
}
else if (j > 1){
s.campaign= s.campaign + “:” + pair[1];
}
}
}

Adam Greco
Emer Kirrane
Eric Peterson
Evan LaPointe
Kevin Rogers
Michele Hinojosa
Pritesh Patel
Rudi Shumpert
One Comment
Jason,
Very clever use of the link handler plugin. I wonder what other things could be handled this way. Got me thinking….
-Rudi