Hey all,

I've inherited a wordpress site which includes an ad extension (id) tagged on inlinks to the site (i.e. example.com/?ad_ext=100) then that extension gets recorded to a cookie (by a file called in wp-blog-header.php) and that cookie content gets recorded in a database when a conversion happens.

The problem is though that for some reason if the person converts (submits a form) on the first page they enter on then the cookie value isn't recorded even though the cookie is made instantly. If they land and refresh the page, or click to go to another page then convert, it records the cookie data properly.

Does anyone have any idea why this might be happening, or alternatively if the code below, which gets the cookie info prior to recording it, could be modified to have an else statement at the end which would grab the ext. number directly from the url.

Any ideas?

Thanks a lot.

Pete

PHP Code:
function adExtNo($defaultExt '1004'){
    if(isset(
$_COOKIE[__FSCOOKIE_PRINT_EXT])){ //Detect custom print media ad ext number
        
$adCookie $_COOKIE[__FSCOOKIE_PRINT_EXT];
        return 
$adCookie;
    }else{ 
//Else detect ppc ad ext number
        
if(isset($_COOKIE[__FSCOOKIE_PPC_EXT])){
                
$adCookie $_COOKIE[__FSCOOKIE_PPC_EXT];
                return 
$adCookie;
        }else{ 
//Else just set ext number to web default
                
return $defaultExt;
        }
    }