Pap_Api_ClickTracker

It is possible to replace standard click tracking using javascript code with PHP version of click tracking.

Javascript version looks like this:

<script id="pap_x2s6df8d" src="URL_TO_PAP/scripts/clickjs.php" type="text/javascript"></script>
<script type="text/javascript">
papTrack();
</script>

PHP version of the click tracking has to be placed on all landing pages (same as by javascript version) and looks like this:
<?php 
    require_once 'PapApi.class.php';

// 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) {
}
?>
$clickTracker->saveCookies(); will output javascript code that saves all necessary cookies. This function outputs javascript code because it needs to save also flash cookies.
Warning: If you do not call this function, sales won't work.

If you do not wish to save cookies using javascript, you can use following code:
    // save cookies
    $clickTracker->save3rdPartyCookiesOnly();
This code will save normal cookies only. Optional parameter for the save3rdPartyCookiesOnly() is cookie domain validity.
Warning: if you save 3rd party cookies only, all tracking (click + sale) will be working on one domain only.


After click is saved (method track() was called) you can use the information about the affiliate through which the click was made. Also you can use the information about the campaign and display it on your site:
    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
}

If you login before calling click tracker you will get additional info for affiliate. To login use following code for session initialization:
    // init session for PAP
$session = new Gpf_Api_Session("URL_TO_PAP/scripts/server.php");
if(!$session->login("MERCHANT_USERNAME", "MERCHANT_PASSWORD")) {
    echo("Cannot login. Message: ".$session->getMessage());
}
Additional info available after login.

Affiliate:
username
rpassword
firstname
lastname
parentuserid
dateinserted - date when affiliate joined the program
dateapproved - date when affiliate was approved
minimumpayout
note
photo
data1 - see Configuration -> Affiliate signup -> Fields
...
data25

Campaign
:
accountid
rtype
rstatus
name
description
dateinserted
rorder
networkstatus
logourl
productid
discontinueurl
validfrom
validto
validnumber
validtype
cookielifetime
overwritecookie
countries
geocampaigndisplay
geobannersshow
geotransregister


Other similar entries
You might find your answer faster than by contacting us!

Change Log

If you don't have latest release of product, please take a look into our change log. Maybe your problem was already resolved in newer release and you can just upgrade your installation to resolve the problem.
Review Change log  

Road Map

Have you suggestion, how to improve our products? Maybe same suggestion is already reported in our road map and you don't need to contact us because of it.
Review Roadmap

Bug Tracker

If you want to report bug, please take a look into our opened bugs. Maybe same bug was already reported. Please don't report same bug next time!
Review opened bugs

Phone Support

Phone support is offered only in English.
Toll Free (USA & Canada): 1-877-374-3995
Skypein: 1-415-8303923
Skype Phone: quality.unit
Other: +421-911-023006

New Support Ticket

Please search for an answer in our knowledgebase first. You might find your answer faster than by contacting us!
Submit New Ticket
Post Affiliate Pro
affiliate software
SupportCenter
help desk software
Live Agent
online chat
UnitMiner
web data extractor

All the menu items will lead
you to qualityunit.com site

Company home About us Our team Company history

Affiliate software

Post Affiliate Pro 4

Powerful affiliate software to power your affiliate program


Customer support

Support Center

Helpdesk, email management and KB

LiveAgent

Live Chat for your web


Other products

Post Member Pro

Membership software

Unit Miner

Web data extraction

All the menu items will open in new window

Knowledgebase Forums Member's area

Earn commission for referring our products

Affiliate program