Intégration de base
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 créer des pages de confirmation spécifiques au produit acheté. C'est là que vous devez coller votre code de suivi.
Les codes de suivi diffèrent d'un système à l'autre, mais ils ressemblent généralement à ceci : <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">
Il vous suffit d'utiliser MemberMouse SmartTags™ pour transmettre les données appropriées au code de suivi, comme démontré ci-dessus. Lisez cet article pour obtenir une liste complète des données de commande disponibles avec le SmartTag Order_Data.
Remarque : 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 le profil de commission et les configurations de paiement des partenaires.
Intégration avancée
Vous pouvez créer des profils de commission et définir les paiements aux partenaires 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.
Notifications push des affiliés
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 apprendre à appeler un script personnalisé lorsque des événements d'affiliation se produisent.
Crochets WordPress d'affiliation
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 en savoir plus sur l'utilisation des crochets WordPress pour les affiliés.
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);
}

