On e-commerce sites, partner payouts can vary by product or product category, and flat commissions based on the total sum of the order are insufficient. Although the Payout & Revenue Groups feature can set payouts based on advertiser sub-ID values, that is only effective when a single item or category is purchased simultaneously. Shopping carts containing multiple product SKUs can have different payouts based on each product or category. Below, we’ll go over how to build a system to do this and track it using TUNE.
Offer Setup
Since the offer setup does not calculate each item separately, the payout for each item/category must be calculated before being passed back to TUNE. We want to set up the offer pixel/postback to capture the total amount passed for the sale, along with the amount that is paid to the partner. To do this, go to Company > Customize Application > Settings > Tracking. Set Specify Amounts on Conversion to “Enabled.” This lets you pass in the partner payout dynamically each time on conversion. A default payout for the offer still needs to be set.
Calculating Payout Amounts
Now that the offer has been set up, you can start implementing the logic to set the payout for each product or category that the purchase comes from. Your shopping cart should be able to pass the product SKU/category ID for each item to calculate these payouts.
The first step is to build a variable for each product/category in the store and set a percentage payout for each option. For example, one product might have a payout of 20%, while another could be set to 25%. The same theory applies to offer categories, each with a payout percentage set.
Let's assume this is for an online clothing store, and the customer bought shoes, pants, and a shirt. Each category has a 5%, 10%, and 15% commission, respectively.
$shoes = .05; $pants = .10; $shirts = .15; $aff_payout = ($shoes_price * $shoes) + ($pants_price + $pants) + ($shirts_price * shirts)
Now that we have calculated and stored the payout given to partners, we can place that into the &amount= parameter in the pixel and fire it.
Once all the payouts have been set, the next step is to pull all the offer SKUs/IDs or category IDs for each item in the order and calculate the payout to the partner by multiplying the purchase price for the product with the payout percentage.
If you are setting different payouts by product category, you will need to group the products in order by their category, get the sum of all the products in the category, and then calculate the payout by multiplying the category subtotal with the payout set. If you have an order with products from multiple categories, then you can calculate the total payout for the sale by adding the total payout for each category together:
Passing Total Commission to TUNE
Once the shopping cart has been modified to calculate the partner's total payout, it is time to record the conversion in TUNE and pass in the total payout for the partner. The actual payout for the partner was already calculated in the cart, so that you can pass the sale amount total in the amount parameter and the amount being paid to the partner in the payout parameter of the offer pixel/postback:
<iframe src="http://demo.go2cloud.org/aff_l?offer_id=2&amount=AMOUNT&payout=PAYOUT&adv_sub=ORDER _ID" scrolling="no" frameborder="0" width="1" height="1"></iframe>
The pixel example has the option to pass in the order ID from the shopping cart as well, which can be good practice for reconciling orders in your conversion report.