SandeepCharanU Posted November 15, 2013 Share Posted November 15, 2013 Hi This is sandeep charna i was new to PHP i am designing a site on PHP in that i would like to put affiliate links(i am a publisher) if any of my site visitors clicks that link and register with that site or signup with that redirected URL his signup process will complete and i will get one lead it is recorded in my merhant's database, i want to track that record if lead is generated i need to know how can i track my visitors weather he/she completed the process or not. i tried so many processes but no use can any one please help me to do this, Please suggest any process or code to track this. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted November 15, 2013 Share Posted November 15, 2013 what have you tried? the point of programming help forums are not to find or to write code for you. help forums are to help you with code you have written. Quote Link to comment Share on other sites More sharing options...
SandeepCharanU Posted November 17, 2013 Author Share Posted November 17, 2013 <?phprequire_once "outbound-tracking.php"; /* The tracking file you upload - I renamed mine to something unique */PiwikTracker::$URL = 'http://www.your-site.com/mystats/'; /* The URL specified in your site tracking code */ $piwikTracker = new PiwikTracker( $idSite = 1 ); /* The Site ID also found in your tracking code */$piwikTracker->setTokenAuth( 'your-auth-code-here' ); /* The token_auth found on the API page of your CP - required to get users IP */$piwikTracker->setVisitorId($piwikTracker->getVisitorId()); /* You need to add this so the user id isn't lost and thier tracking starts over */$piwikTracker->setIp( $_SERVER['REMOTE_ADDR'] ); /* Log visitor IP if you like */$piwikTracker->setUrl($url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); /* Set the current URL */$piwikTracker->doTrackPageView( $_GET['id'] ); /* Log the Visit */?><?php $id = $_GET['id']; $redirect = array('name1'=>'http://www.affiliatelink1.com/''name2'=>'http://www.affiliatelink2.com/' ); header('HTTP/1.1 301 Moved Permanently'); header('Location:'.$redirect[$id]); header('Connection: close'); exit();?> This is the code i was using but it was recording only the affiliate link what is the user selected on my site but i want to record weather He/She generate the lead to me or not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.