Posted By

jurajsim on 01/25/11


Tagged

click api pap


Versions (?)

pap click tracking api


 / Published in: PHP
 

track click and get aff/campaign info

  1. / init session for PAP
  2. $session = new Gpf_Api_Session("URL_TO_PAP/scripts/server.php");
  3.  
  4. // register click
  5. $clickTracker = new Pap_Api_ClickTracker($session);
  6. try {
  7. $clickTracker->track();
  8. $clickTracker->saveCookies();
  9. } catch (Exception $e) {
  10. }
  11.  
  12. if ($clickTracker->getAffiliate() != null) {
  13. echo $clickTracker->getAffiliate()->getValue('userid'); // prints affiliate userid
  14. echo $clickTracker->getAffiliate()->getValue('refid'); // prints affiliate refid
  15. }
  16.  
  17. if ($clickTracker->getCampaign() != null) {
  18. echo $clickTracker->getCampaign()->getValue('campaignid'); // prints campaign id
  19. }

Report this snippet  

You need to login to post a comment.