UTM parameter errors

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 11, 2014   (RSS)

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/