Assigning Payouts by Product Categories / Different Payouts per Product

On e-commerce sites, partner payouts can vary by product or product category, and flat commissions based on the total sum of the order is 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 at a time. Shopping carts containing multiple product SKUs can have different payouts based on each product or product category. Below, we’ll go over how to build out 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 a purchase comes from. Your shopping cart should be able to pass the product SKU/category ID for each item in the order 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 category will have 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 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 that is going to be 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 calculating the payout to the partner by multiplying the purchase price for the product with the payout percentage.

If you are setting different payout by product category, then you will need to group the products in the order by their category, get the sum of all the products in the category, then calculate the payout for the category 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 total payout the partner receives, 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 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=";amount=AMOUNT&amp;payout=PAYOUT&amp;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 to reconcile orders in your conversion report.