/ Published in: PHP
track click and get aff/campaign info
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/ init session for PAP $session = new Gpf_Api_Session("URL_TO_PAP/scripts/server.php"); // register click $clickTracker = new Pap_Api_ClickTracker($session); try { $clickTracker->track(); $clickTracker->saveCookies(); } catch (Exception $e) { } if ($clickTracker->getAffiliate() != null) { echo $clickTracker->getAffiliate()->getValue('userid'); // prints affiliate userid echo $clickTracker->getAffiliate()->getValue('refid'); // prints affiliate refid } if ($clickTracker->getCampaign() != null) { echo $clickTracker->getCampaign()->getValue('campaignid'); // prints campaign id }