SimpleShop integration
SimpleShop integration is about adding the integration code to thank you page and setting up a plugin to track payments (automatic approval).
Sale tracking code
Log in to your SimpleShop admin panel and navigate to Settings section and click Conversion Tools link in the Selling section.
Insert the following code to the Custom conversion codes:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var orderId = '{id}';
var callBack = false;
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/SimpleShop/webhook.php?visitorId='
+getVisitorId()+'&id='+orderId+'&ac=sale';
document.body.appendChild(pixel);
}
}
try {
PostAffTracker.track();
PostAffTracker.executeOnResponseFinished.push(function() {visitorCallBack();});
}
catch(e){}
</script>
Save your changes. This will track a commission which should be pending (setup your campaign to manual status approval).
Setup SimpleShop plugin in merchant panel
To automatically approve commissions after orders were paid you have to enable the SimpleShop plugin. Login to your merchant panel and navigate to Plugins section. Find and enable SimpleShop plugin.
When enabled configure it – you will need your SimpleShop username (the one you use to login to your admin panel) and an API key. You can get your API key in your SimpleShop Settings section in Integration section after clicking the API link.
Add webhook for automatic approval
With the plugin active you have to take one last step to finish the integration. You have to add the plugin URL to each product you want to track for automatic commissions approval. Navigate to Products in your SimpleShop admin and edit each. Navigate to Various tab and add the following URL to the URL webhook field:
https://URL_TO_PostAffiliatePro/plugins/SimpleShop/webhook.php?ac=webhook&id={id}
Click tracking code
The click tracking code has to be implemented in the website where you host your SimpeShop order forms.