Intergrate Marketpress with zferral?

Is there any way, to intergrate Marketpress with zferral? anyone have idea where to put code like

<?php // Make sure this is placed BEFORE any http headers
  require_once(dirname(__FILE__).'/zferralApi/ZferralLoader.php'); // Change path if needed
  $c = new ZferralCookie();
?>

<?php // Place this code on success page
  $con = new ZferralConnector($apikey, $subdomain);

  $call = $con->call(
    'event',
    array(
     'campaign_id'   => 1,           // NOTE: This is the ID of your campaign in zferral
     'revenue'       => $rev,        // NOTE: Enter the price of your product
     'customer_id'   => $customerId, // NOTE: (OPTIONAL) Enter ID of customer who completed the event
     'unique_id'     => $uniqueId,   // NOTE: (OPTIONAL) Enter some unique ID for extra security
     'coupon'        => $coupon      // NOTE: (OPTIONAL) Enter affiliate coupon
    ), $debug = false);
?>

where to put this ping code in marketpress, please help