The Action Code is an HTML snippet that sends a signal to the 2Performant system when an action has been registered on a merchant’s website.
In the Campaign page click 'Show Action Codes' and it will generate a unique code for your campaign.
Example: a code for a Per Sale campaign with fixed sale percentage looks like this:
<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='http://event.2parale.ro/events/salecheck?amount=__ADD_SALE_VALUE__&campaign_unique=04dd73cf6&confirm=d04175f90cc4c490&description=__ADD_DESCRIPTION__&transaction_id=__ADD_TRANSACTION_ID__'></iframe>
This code must be added on the sale success page "Thank You for Ordering" (if a Per Sale Campaign) or on a page that marks a succesful completion of an action (if a Per Lead Campaign).
Contents:
Per Lead
Fixed Commissions
A code example for a Per Lead campaign looks like this:
<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='http://event.2performant.com:3000/events/leadcheck?campaign_unique=04dd73cf6&confirm=d04175f90cc4c490&description=__ADD_DESCRIPTION__&transaction_id=__ADD_TRANSACTION_ID__' />
(example, real code is found in campaign page)
Where:
Replace __ADD_TRANSACTION_ID__ with an unique identified that identifies the transaction in your database.
Replace __ADD_DESCRIPTION__ with a message containing information about the transaction.
Add this code on the page that marks the succes of an action. Example: on the account signup confirmation page if promoting user signups.
Variable Commissions
A code example for a Per Lead campaign with variable commissions looks like this:
<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='http://event.2performant.com:3000/events/leadcheck?campaign_unique=04dd73cf6&confirm=d04175f90cc4c490&description=__ADD_DESCRIPTION__&transaction_id=__ADD_TRANSACTION_ID__&com_rate=__ADD_AFFILIATE_LEAD_COMMISSION__' />
(example, real code is found in campaign page)
Where:
Replace __ADD_TRANSACTION_ID__ with an unique identified that identifies the transaction in your database.
Replace __ADD_DESCRIPTION__ with a message containing information about the transaction.
Replace __ADD_AFFILIATE_LEAD_COMMISSION__ with the commission value the affiliate will receive.
Add this code on the page that marks the succes of an action. Example: on the account signup confirmation page if promoting user signups.
Per Sale
Fixed Commissions
In the case of Fixed Commissions the code is similar to that of Per Lead:
<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='http://event.2performant.com:3000/events/salecheck?amount=__ADD_SALE_VALUE__&campaign_unique=04dd73cf6&confirm=d04175f90cc4c490&description=__ADD_DESCRIPTION__&transaction_id=__ADD_TRANSACTION_ID__'></iframe>
(example, real code is found in campaign page)
Where:
Replace __ADD_SALE_VALUE__ with the total sale amount minus transport costs.
Replace __ADD_TRANSACTION_ID__ with an unique identifier that identifies the transaction.
Replace __ADD_DESCRIPTION__ with a message containing information about the transaction.
This code must be added on the sale success page "Thank You for Ordering".
Fixed Percentage Commissions
Code looks like this:
<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='http://event.2performant.com/events/salecheck?amount=__ADD_SALE_VALUE__&campaign_unique=04dd73cf6&confirm=d04175f90cc4c490&description=__ADD_DESCRIPTION__&transaction_id=__ADD_TRANSACTION_ID__'></iframe>
(example, real code is found in campaign page)
Where:
Replace __ADD_SALE_VALUE__ with the total sale amount minus transport costs.
Replace __ADD_TRANSACTION_ID__ with a unique identifier that identifies the transaction.
Replace __ADD_DESCRIPTION__ with a message containing information about the transaction.
This code must be added on the sale success page "Thank You for Ordering".
Variable Percentage Commissions
This type of commission structure allows you to assign different commission percentages for products. This was implemented in case you can offer 5% for DVDs but only 3% for hardware. It is also the hardest to implement.
Code looks like this:
<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='http://event.2performant.com/events/salecheck?amount=__ADD_SALE_VALUE__&campaign_unique=04dd73cf6&com_percent=__ADD_AFFILIATE_SALE_COMMISSION_PERCENT__&confirm=d04175f90cc4c490&description=__ADD_DESCRIPTION__&transaction_id=__ADD_TRANSACTION_ID__'></iframe>
(example, real code is found in campaign page)
Where:
Replace __ADD_TRANSACTION_ID__ with a unique identifier that identifies the transaction.
Replace __ADD_DESCRIPTION__ with a message containing information about the transaction.
The other two variables, __ADD_SALE_VALUE__ and __ADD_AFFILIATE_SALE_PERCENTAGE__ can be sent in two ways:
Simple Format:
-
Sale Value - total sale amount minus transport cost
-
Affiliate Sale Percentage - the final sale percentage that is given to the affiliate, calculated according to the purchased goods:
- Considering productA 10USD with 10% commission and productB 20USD with 5% commission
- 10% from 10USD = 1USD, 5% from 20USD= 1USD
- 1USD + 1USD from 30USD (total) = 7(%)
Advanced Format(recommended):
- Sale Value - an YAML encoded_url array that contains the price of every product
- Affiliate Sale Percentage - an YAML encoded_url array that contains the commission for each product
Best Practices
Description Field
The action description field is optional but very useful to affiliates. We recomend the following structure:
- [no. of items sold] x Product Name A, [no. of items sold] x Product Name B
Make sure:
- the description is URL Encoded.
- That means using functions especially made for that like PHPs urlencode() or in Javascript encodeURI(). All special characters except - and _ should be converted into a sequence that starts with %.
- there are no HTML tags in the content (like <b> or <font>)
Adding Promotional Tools