Integración básica
Most affiliate systems will provide you with a tracking code that you can insert on a thank you page or confirmation page. Since this page is only displayed to the customer following a purchase, including the tracking code here means that you’re only tracking commissions when a sale has occurred. In MemberMouse you can crear páginas de confirmación específicas para el producto adquirido. Aquí es donde debe pegar su código de seguimiento.
Los códigos de seguimiento varían de un sistema a otro, pero suelen tener este aspecto: <img border="0" src="http://www.youraffiliatesystem.com/sale.php? affiliate_id=[ MM_Order_Data name='affiliateId' ]& order_total=[ MM_Order_Data name='total' ]& order_number=[ MM_Order_Data name='id' ]& ip_address=[ MM_Order_Data name='ipAddress' ]" width="1" height="1">
Todo lo que tiene que hacer es utilizar MemberMouse SmartTags™ para pasar los datos apropiados al código de seguimiento como se ha demostrado anteriormente. Lea este artículo para obtener una lista completa de los datos de pedido disponibles con el SmartTag Order_Data.
Nota: When you use this approach you won’t be able to take advantage of commission profiles or partner payouts. This is because you’re manually tracking a commission on the confirmation page so you’re bypassing the place where MemberMouse determines whether to track the commission based on perfil de comisiones y configuraciones de pago a socios.
Integración avanzada
Puede crear perfiles de comisiones y definir los pagos a los socios in MemberMouse that allow you to configure when you want to track commissions. In order to take advantage of these configurations, you’ll need to let MemberMouse inform you when to make a call to your affiliate system to track a commission. You can accomplish this by listening for affiliate push notifications or creating functions that respond to affiliate WordPress hooks.
Notificaciones push para afiliados
One way to ensure you’re only tracking commissions in accordance with commission profiles and partner payout configurations is to put all of the code required to inform your affiliate system in scripts that are called by the MemberMouse push notification system. Read this article to aprenda a llamar a un script personalizado cuando se producen eventos de afiliación.
Ganchos WordPress para afiliados
Another way to ensure that you’re only tracking commissions in accordance with commission profiles and partner payout configurations is to put all of the code required to inform your affiliate system in functions that are tied to affiliate WordPress hooks. Below is an example of how you could attach a function to the mm_commission_initial hook. Read this article to más información sobre el uso de ganchos WordPress para afiliados.
add_action('mm_commission_initial', 'track_commission');
function track_commission($data)
{
$orderNumber = $data["order_number"];
$orderTotal = $data["order_total"];
$orderAffiliateId = $data["order_affiliate_id"];
$orderIPAddress = $data["order_ip_address"];
// access coupons associated with the order
$couponCode = "";
$coupons = json_decode(stripslashes($data["order_coupons"]));
foreach($coupons as $coupon)
{
$couponCode = $coupon->code;
break;
}
// generate URL to track commission
$url = "http://www.youraffiliatesystem.com/sale.php?";
$url .= "affiliate_id={$orderAffiliateId}&";
$url .= "order_total={$orderTotal}&";
$url .= "order_number={$orderNumber}&";
$url .= "coupon_code={$couponCode}&";
$url .= "ip_address={$orderIPAddress}";
// call URL using cURL
$request = curl_init($url);
curl_exec($request);
}

