Zenler integration
The integration of Zenler is divided into two main steps. The first is to make sure you track (even a zero) commission for registration. This is to ensure an affiliate is linked with a customer. The second step then is to create a webhook notification from Zenler to Post Affiliate Pro notifying about a new order.
1. Lead/Registration tracking
As mentioned this step is necessary to create a relation between customer and affiliate. To make use of it, enable Lifetime Commissions plugin. The code to track a customer with their email is below. You will have to make sure the value loading fits your site (element ID or class name, etc…).
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
document.getElementsByClassName('zen-subscribe btn-submit')[0].addEventListener("click", function (){papSale()});
function papSale() {
var email = document.getElementsByName('email')[0].value;
var sale = PostAffTracker.createAction('registration');
sale.setOrderID(email);
sale.setProductID('The form name');
sale.setData1(email);
sale.setCampaignID('11111111');
PostAffTracker.register();
}
</script>
2. Data notification
When you have a form integrated you can connect your Zenler sales to PAP. You have to do this with any course or bundle that you want to track. Edit the course or bundle and navigate to Automation section. Click the Edit Automation Rules button on right and add a new rule. The action would be “Send a webhook”. This is your webhook URL:
URL_TO_PostAffiliatePro/plugins/Zenler/zenler.php
When done you just have to enable Zenler plugin in your Post Affiliate Pro merchant panel and do not forget to add click tracking code to your pages.