You need a minimum of 4 pieces of information to track clicks remotely via a HTTP request. These are:
- Secret word (the secret word that you have specified in the settings)
- Referrer ID (the affiliate ID)
- Client’s Browser Information
- Client’s IP Address
Optionally, you can pass in the following additional data too:
- The Referred Site’s URL
1. Tracking Clicks via HTTP GET request
To track clicks via HTTP GET use the following format:
http://www.example.com/wp-content/plugins/wp-affiliate-platform/api/remote-click-track.php?secret=XX&ap_id=YY&clientbrowser=ZZ&clientip=AA
Replace the “example.com”, “XX”, “YY”, “ZZ”, “AA” with the appropriate value.
PHP Example
The following is an example of how to construct this link using PHP:
$secret = "4bd39e2e4a7bb";
$referrer = "amin21";
$clientbrowser = $_SERVER['HTTP_USER_AGENT'];
$clientip = $_SERVER['REMOTE_ADDR'];
$prepared_data = "?secret=".$secret."&ap_id=".$referrer."&clientbrowser=".$clientbrowser."&clientip=".$clientip;
$get_url = "http://www.example.com/wp-content/plugins/wp-affiliate-platform/api/remote-click-track.php".$prepared_data;
2. Awarding Commission via HTTP POST request
To award commission via HTTP POST use the following format:
<form action="http://www.example.com/wp-content/plugins/wp-affiliate-platform/api/remote-click-track.php" method="post">
<input name="secret" type="hidden" value="XX" />
<input name="ap_id" type="hidden" value="YY" />
<input name="clientbrowser" type="hidden" value="ZZ" />
<input name="clientip" type="hidden" value="AA" />
<input type="submit" value="Submit Post" />
</form>
Replace the “example.com”, “XX”, “YY”, “ZZ”, “AA” with the appropriate value.
Leave a Reply