–Hidden comment

Use attributes in format region_from and region_to= to change the languages showing in language switcher.
Available regions are:
europe_from europe_to
asia_from asia_to
mideast_from mideast_to
america_from america_to

europe_from=0 europe_to=22 will put all languages (ordered in language switcher settings) from 1 to 21 to Europe region:
asia_from=22 asia_to=25 will put all languages from 23 to 24 (so only 2) into Asia region.


Accept membership payments, manage profiles, deliver digital content, integrate with your blog, CMS, send newsletters, run affiliate program with this software.

This integration method is for aMember versions lower than v4.

Integration with aMember uses a variation of General solution, it tracks sales by invoking hidden script from “thank you” page.


Put the following code to the aMember thanks.html page:

<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();


2. Integration of recurring sales with PayPal

If you want to integrate aMember with PayPal recurring payments then follow these instructions. You will have to find the paypal_r.inc.php on your server /amember/plugins/payment/paypal_r

Insert next code right after this line:
function paypal_validate_ipn($vars){

/* PAP integration */
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, "https://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php");
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
/* end of PAP integration */

Now find this line (2x times):

'custom' => '',

and change them to:

'custom' => $_COOKIE['PAPVisitorId'],

Notice, that your cookies must be available at the domain where amember is installed in order to track sales.

3. Signup form integration

It’s possible to integrate Amember in way, that every new user signup will create also affiliate account in your PAP in the same time. This integration is using our API, therefore it’s necessary to upload PapApi.class.php into your Amember main folder. Then locate file signup.php (also in the main folder), open it in some text editor and add following code right after this line:

proceed_to_payment($payment_id, $member_id_exists);

          try {
                $session = new Gpf_Api_Session("https://URL_TO_PostAffiliatePro/scripts/server.php");
                if(!$session->login("merchant_username", "merchant_password")) {
                $affiliate = new Pap_Api_Affiliate($session);
                if(!$affiliate->add()) {
                    //echo "Cannot save affiliate: ".$affiliate->getMessage();
                } else {
                    // affiliate was successfully added
            } catch(Exception $e) {
                //echo "Error while communicating with PAP: ".$e->getMessage();

This is all that is required. Now whenever there’s sale, aMember will call our sale tracking script, and system will generate commission for the affiliate.

Back to Integrations Create account for FREE

Our website uses cookies. By continuing we assume your permission to deploy cookies as detailed in our privacy and cookies policy.


Schedule a one-on-one call and discover how Post Affiliate Pro can benefit your business.

We’re available on multiple dates

Schedule a call