Kartra integration
Drive sales with the most powerful all-in-one platform. The integration is divided into two steps – the lead tracking to create a lifetime relation for customer and their referring affiliate and the sale tracking tracked thanks to the Outbound API and built-in Kartra plugin.
1. Add the lead tracking code
Navigate to Pages section and edit each page you want to track. When editing the page add a new ‘Your Code’ section to the bottom of the site with your checkout form. Use this code for the new section (replace the code that is there by default):
<div data-embed="true">
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
document.getElementsByName('submit')[0].addEventListener("click", function (){papSale()});
function papSale() {
var email = document.getElementById('email').value;
if (email == '') return;
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createAction('lead');
sale.setProductID('Customer registration');
sale.setCampaignID('11111111');
sale.setOrderID(email);
sale.setData1(email);
PostAffTracker.register();
}
</script>
</div>
The above code needs some changes so feel free to contact us. The logic of the code is to listen to a click of the form’s submit button and trigger a lead tracking code in the default campaign, to track the lead and create a lifetime relation. To make it all working you also need the Lifetime Commission plugin to be active.
2. Add the sale tracking code
As already mentioned, the sale tracking works thanks to Kartra’s Outbound API. Navigate to Integrations> API> My API and enable Outbound API. Set the URL to your plugin’s URL:
https://URL_TO_PostAffiliatePro/plugins/Kartra/kartra.php
And finally, enable the Kartra plugin in your merchant panel.
That’s it. This will track sales (and their refunds) from your Kartra.
Do not forget to integrate your site. You can use the page’s Settings> Tracking codes – place the click tracking code to the section designed for <footer>