We ended up implementing the method that I posted above... we capture the GET variable in the URI by using something like:
Code:
if (!empty($_GET['tracking_code']))
$_SESSION['tracking_code'] = $_GET['tracking_code'];
at the bottom of the index.php page. That will sessionize the variable so that you can access it later on. Make sure that you sanitize the variable before sessionizing it though, just to be safe! Also, be sure to not use a variable name that conflicts with core ZC variables.
Then, in includes/modules/pages/checkout_success/header_php.php, I wrote a custom function which grabs my sessionized tracking code and writes it to a unique database table.
You could do something similar by writing the tracking code (plus any other pertinent data) to your own db table when someone registers and then retrieve it later on. You'll just have to explore the modules to figure out where the registration happens. Make sure that you take good notes, because you'll have to re-write all of that code when you upgrade ZC.
Good luck!
Kevin
Bookmarks