Click tracking request data description

Post Affiliate Pro tracking is based on requests between client (banner destination web page, 'thank you page') and server. 
If it is the first request, browser visitor cookie is not loaded, the server generates a new cookie value and sends it to the client as a response. JavaScript on Client will store the received cookie value to browser and flash cookie.
If browser visitor cookie is loaded and inserted into request parameter 'visitorId', then response is empty and click/sale is saved under affiliate recognized from cookie.

Click tracking request

This request is sent from click tracker to Post Affiliate Pro server:
Request url is your PAP/PAN url to file track.php in the 'scripts' directorys : http://my_pap_url/scripts/track.php

Url parameters:

visitorId: loaded from browser cookie (let it empty if doesn't exist in browser cookie - common for first click): for value in php use: @$_COOKIE['PAPVisitorId'];

- accountId: for Post Affiliate Pro you can let it empty or set value 'default1', for Post Affiliate Network you need to set there the accountid of a particular PAN merchant account 

- url: URL to script file  where the script is running. We are filling it as: my script is on url: http://my_url/tests/api/click.php, 'http://' is replaced with 'H_' and 'https://' is replaced with 'S_',  
In php we get from $_SERVER['HTTPS'] if protocol is http or https, server name is from $_SERVER["SERVER_NAME"], and script name from $_SERVER['PATH_INFO'] or $_SERVER['SCRIPT_NAME'] 

referrer: loaded from $_SERVER['HTTP_REFERER'], 'http://' is replaced with 'H_' and 'https://' is replaced with 'S_' (same as url) 

tracking: in click tracking contains value: 1

- getParams: contains all get params from url, for example: url used to visit this page by visitor is: http://my_url/tests/api/me/click.php?a.aid=testaff&a_bid=11110001 so getParams will contain a_aid=testaff&a_bid=11110001 (in php loaded from $_GET), every one param value is encoded with urlencode($value) 

- ip: visitor IP, in php loaded from $_SERVER['REMOTE_ADDR'] or $_SERVER['HTTP_X_FORWARDED_FOR'] 

useragent: loaded from $_SERVER['HTTP_USER_AGENT'] 


Response after executing this request will contain the generated cookie (only for first click if  cookie value of parameter visitorId  is empty), response with cookie looks like this: 
(for next visits/requests from the same visitor it will be empty) 
if response is not empty and you need to create a browser/flash cookie for this visitor, then along the php api tracking ther is a javascript code added and it is executed by the browser: 

echo '<script id="pap_x2s6df8d" src="http://my_pap_url/scripts/trackjs.js" type="text/javascript"></script>'; 
echo '<script type="text/javascript">setVisitor('b57b0406c5b9febba85ce10J1xJqsL8Z');</script>'; 
javascript function setVisitor() from file trackjs.js will create browser cookie  and flash cookie with name PAPVisitorId and with corresponding cookie value (in this case: b57b0406c5b9febba85ce10J1xJqsL8Z).