Post Affiliate Pro tracking is based on requests between client (banner destination web page, 'thank you page') and server.
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 : https://my_pap_url/scripts/track.php
- 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: https://my_url/tests/api/click.php, 'https://' 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: https://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)