Track traffic sources using PHP get?
-
I'm trying to implement a simple tracking ID in my Wordpress theme. It would work like this, I put links out on the internet including a get parameter as follows: http://www.mywebsite.com?track\_id=myid When visitor travels to my site through the link it latches the track_id as they click through the site and doesn't release the id until they leave. At any given point in the visitor's session I want to look up which affiliate referred them to my site so if the visitor buys anything I can track my sales and which traffic sources and or affiliates are working out the best. It seems pretty simple but I cannot figure out how to latch the tracking ID to a visitors session on the site.... Anybody know??? Thanks!!!!
-
I'm trying to implement a simple tracking ID in my Wordpress theme. It would work like this, I put links out on the internet including a get parameter as follows: http://www.mywebsite.com?track\_id=myid When visitor travels to my site through the link it latches the track_id as they click through the site and doesn't release the id until they leave. At any given point in the visitor's session I want to look up which affiliate referred them to my site so if the visitor buys anything I can track my sales and which traffic sources and or affiliates are working out the best. It seems pretty simple but I cannot figure out how to latch the tracking ID to a visitors session on the site.... Anybody know??? Thanks!!!!
Would simply using PHP's built-in session handling be sufficient for your purposes? see, e.g., http://www.tizag.com/phpT/phpsessions.php[^] If not, let me know exactly why not and maybe we can come up with an alternative idea.
--Greg
-
I'm trying to implement a simple tracking ID in my Wordpress theme. It would work like this, I put links out on the internet including a get parameter as follows: http://www.mywebsite.com?track\_id=myid When visitor travels to my site through the link it latches the track_id as they click through the site and doesn't release the id until they leave. At any given point in the visitor's session I want to look up which affiliate referred them to my site so if the visitor buys anything I can track my sales and which traffic sources and or affiliates are working out the best. It seems pretty simple but I cannot figure out how to latch the tracking ID to a visitors session on the site.... Anybody know??? Thanks!!!!
You could use a session cookie then retrieve the value from $_COOKIE as they move thru the site.