JotForm is an online service for form creation. You can setup a forms with payment buttons and this integration is exactly for those, in case you want to track orders done by any of your JotForm forms.

1.

JotForm setup

To be able to track your form results, you have to setup two options in JotForm admin:

  • set a form "thank you" page in each form (choose one where you will be able to insert PHP code)
  • set preferences of the form to send POST data to thank you page (edit form> Preferences> Advanced Settings)

Save your changes.

2.

Thank you page integration

Now you have to integrate the page you've chosen in preferences of your forms. This is the code, just paste it into your PHP thank you page:

<?php /********* Post Affiliate Pro integration snippet *******/
if (isset($_POST['enteryour4'])) {
  // total cost
  $total = 0;

  if (isset($_POST['selectyour'])) {
    $select = "selectyour";
  }
  else {
    for ($i = 0; $i < 100; $i  ) {
      if (isset($_POST["selectyour".$i])) {
        $select = "selectyour".$i;
      }
    }
  }

  foreach ($_POST[$select] as $row) {
    $t = str_replace('{"',"",stripslashes($row));
    $t = str_replace('"}',"",$t);
    $vals = explode('","',$t);
    foreach ($vals as $row) {
      $pairs = explode('":"',$row);
      if ($pairs[0] == 'price') {
	$total = $total   $pairs[1];
      }
    }
  }
?>
<script type="text/javascript">
	document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "URL_TO_PostAffiliatePro/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
</script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('<?php echo $total; ?>');
sale.setOrderID('<?php echo $_POST['enteryour4']; ?>');
sale.setProductID('<?php echo $_POST['enteryour']; ?>');
PostAffTracker.register();
</script>
<?php
}
/********  Post Affiliate Pro integration snippet *******/
?>

The tracking code uses your custom variables, so you have to check in the code, if yours are the same.
In the example, we are using:
enteryour - which stands for customer full name
enteryour4
- which stands for email
and selectyour - which stands for the product your customer has chosen


Do not forget you have to integrate your landing pages with the click tracking code.