This integration method is for AWeber application by www.aweber.com
The integration can create unique lead commission after verification of the email address of the customer. You can also use part of this integration to automatically create affiliate after customer confirms his email address.

1.

Necessary settings

First, you have to setup AWeber. Navigate to My Lists tab and to Confirmed Opt-In. Here, you should setup email text but the most important part is to define Confirmation Success Page. Insert the link to your "after confirmation" page here - the page will contain lead tracking code and API code for adding new affiliate. This page have to be PHP. Lets say we will create the site named lead.php

http://www.yoursite.com/lead.php

To properly track all the data you need to do one more step. There is a checkbox "Pass subscriber info" - please enable this option.

2.

Adding the code for lead tracking

In our file lead.php there is already some code with message "Thank you for .......". This is a page where only approved customer can come, so this is the best place to insert lead tracking code. Please, insert it to the end of the page code, over the </body> tag.


<script type="text/javascript">

var sale = PostAffTracker.createSale();
sale.setOrderID('<?php echo $_GET['meta_message']; ?>');
sale.setProductID('<?php echo $_GET['unit']; ?>');
PostAffTracker.register();
</script>

3.

Adding the code for creating new affiliate

This is the code for work with PAP API so if you do not have "lead.php" page at same server as PAP, you will need to copy file api/PapApi.class.php from PAP server and paste it to server with "lead.php" page. Here comes the code:

<?php
include 'PapApi.class.php'; // here you have to define path to the file

// login (as merchant) - here you have to setup merchant credentials
$session = new Gpf_Api_Session("http://URL_TO_PostAffiliatePro/scripts/server.php");
if(!$session->login("merchant@example.com", "password")) {
  die("Cannot login. Message: ".$session->getMessage());
}

$affiliate = new Pap_Api_Affiliate($session);
$affiliate->setUsername($_GET['email']);
$affiliate->setFirstname("AWeber- ");
$affiliate->setLastname($_GET['name']);

try {
  if ($affiliate->add()) {
    // echo "Affiliate saved successfuly";
  } else {
    die("Cannot save affiliate: ".$affiliate->getMessage());
  }
} catch (Exception $e) {
    die("Error while communicating with PAP: ".$e->getMessage());
}
?>

4.

aWeber plugin for PAP

(Integration plugin developed by third party company)
Each time a new affiliate joins your affiliate program in PAP, this plug-in notifies AWeber so that the affiliate is also added to the AWeber list that's specified.
Details on the AWeber plug-in for Post Affiliate Pro are posted on site:

http://www.winningware.com/affiliate-software/aweber-post-affiliate-pro.php

Details about the plug-in and how to install and configure it are located in the README file