We have customers that come from other sites and I would like to retain a url parameter /?lead=openeye throughout the time that they're browsing. That way when they fill out a form I can capture the lead for sales.
How do I retain url parameters the entire time they're browsing the site.
I've began using a combination of sessions and cookies to accomidate this. It sort of works but doesn't seem to stick for more than a few seconds between pages.
In the header
<?php $lead = $_GET['lead']; $_SESSION['lead'] = $lead; $url = parse_url(get_bloginfo('url')); setcookie("lead", $lead, 0, $url['path'], $url['host']); (set) ?>
<?php echo ($_COOKIE['lead']); // Lead Cookie ?>