Pulling Query String Parameter via Coremetrics
Here is javascript code that will pull in the query string parameter to Coremtrics. This is helpful when tracking items that use query string parameters to pass additional data points.
This code should be placed within the cmdatautils.js file.
//For getting query string from the URL
function getQueryString(y) {
var URL = window.location.search.substring(1);
var x = URL.split(“?”);
for (i=0;i<x.length;i++) {
var 1stParam = x[i].split(“=”);
if (1stParam[0] == y) {
return 1stParam[1];
}
}
return “”;
}
Written by:
Dorian D. Regester
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

