Partner
Fast and easy to use e-commerce shopping cart.
This integration method is for Ecwid shopping cart. The integration is done with a special code inserted into the cart ‘Thank you‘ page in Ecwid and a plugin in your Post Affiliate Pro merchant panel. The plugin works with ECWID API.
With the plugin you can track per order and per product commissions and you can track coupons. The plugin enables automatic affiliate registration, Lifetime commissions tracking and automatic approval, declining and refunding of commissions. Commmissions are created with status based on the status of the order placed and the status can be additionally changed thanks to step 4 of the guide.
Enabling the special section
Login to your Ecwid account and navigate to Settings > General > Cart. In the lower section Checkout Settings enable Tracking code on “Thank you for your order” page.
Sale tracking
When tracking code section is enabled, you can easily insert the needed tracking code to your shopping cart:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
var orderId = '%order_id%';
var callBack = false;
PostAffTracker.setAccountId('Account_ID');
function getVisitorId() {
return PostAffTracker._getAccountId() + PostAffTracker._cmanager.getVisitorIdOrSaleCookieValue();
}
function visitorCallBack() {
if (callBack == false && "null" != getVisitorId()) {
callBack = true;
var pixel = document.createElement("img");pixel.width=1;pixel.height=1;
pixel.src = 'https://URL_TO_PostAffiliatePro/plugins/EcwidAPI/ecwidapi.php?visitorId=' + getVisitorId() + '&orderId=' + orderId;
document.body.appendChild(pixel);
}
}
try {
PostAffTracker.track();
PostAffTracker.executeOnResponseFinished.push(function() {visitorCallBack();});
}
catch(e){}
</script>
Save the code.
Enable the tracking plugin
The final step is to activate your Ecwid plugin in your Post Affiliate Pro merchant panel. The plugin needs an authorization first, so navigate to ‘More Info‘ section of the plugin. When it is authorized, you can then configure the plugin and start tracking your sales.
Ecwid used in WIX
In case you use ecwid in WIX, then you can’t use the JavaScript version of sale tracking code, because WIX loads each part of the sale tracking code in a separate iframe and that breaks the code.
Therefore you have to use the hidden pixel version of code:
<img src="https://URL_TO_PostAffiliatePro/scripts/sale.php?TotalCost=%order_subtotal%&OrderID=%order_id%" width="1" height="1" />
That’s it.
Do not forget to integrate your site with the click tracking code so the sale tracking will work correctly.