UTM parameter errors
2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 11, 2014 (RSS)
Hi there,
Have some urls providing errors with google analytics utm parameters.
Example - 404:
I think its to do with some of the extra sorting functions perhaps (see attached), any suggestions?
By claire - September 11, 2014
Hi there - it looks like the code you're using to parse out the record number doesn't work with UTM fields. Take this code:
$recordNum = 1;
foreach($_REQUEST as $key => $item){
if($key != 'page' && $key != 'sort' ){
$recordNum = preg_replace("/[^0-9,.]/", "",$item);
break;
}
}
Change it like so:
$recordNum = 1;
foreach($_REQUEST as $key => $item){
if($key != 'page' && $key != 'sort' && strpos($key, 'utm') === false){
$recordNum = preg_replace("/[^0-9,.]/", "",$item);
break;
}
}
I think that'll help.
Claire Ryan
interactivetools.com
Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/