pap click tracking api


/ Published in: PHP
Save to your folder(s)

track click and get aff/campaign info


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.