You could use cookies? For example on your landing page;
if(!isset($_COOKIE['HTTP_REFERER']))
{
$expiryTime = time()+(60*60*24); // Set to expire after 1 day
setcookie('HTTP_REFERER',$_SERVER['HTTP_REFERER'],$expiryTime,'/');
}
And then on all other pages you can detect if there is a cookie already set;
if(isset($_COOKIE['HTTP_REFERER']))
{
$referer = $_COOKIE['HTTP_REFERER'];
}