Teachable lets you easily create and sell online courses even with no design or coding experience.

The integration requires you to edit thank you pages for all courses which you wish to track. It enables you to use per product tracking, lifetime commissions and multiple currencies.

1.

Thank you page integration

Teachable currently doesn't have one general thank you page and therefore it requires you to add tracking codes to every single course you wish to track with Post Affiliate Pro. To do this navigate in your teachable admin account to Courses->Edit a course->Thank You Page and enter there the following code:

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script> <script type="text/javascript">
function getTokens(){
    var tokens = [];
    var query = location.search;
    query = query.slice(1);
    query = query.split('&');

    $.each(query, function(i,value){
        var token = value.split('=');
        var key = decodeURIComponent(token[0]);
        var data = decodeURIComponent(token[1]);
        tokens[key] = data;
    });    return tokens;
}

tokens = getTokens();
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost(tokens['final_price']/100);
sale.setOrderID(tokens['sale_id']);
sale.setProductID(tokens['purchased_course_id']);

PostAffTracker.register();
</script>

If you wish to use Lifetime Commissions then you can select whether you wish to add user's ID or user's email address (ID is recommended since it shouldn't change) and add under the line sale.setProductID either
sale.setData1(tokens['user_id']); or sale.setData1(tokens['email']);

If you are selling in multiple currencies and you want to correctly track the commissions using Multiple Currencies feature then also add this line:
sale.setCurrency(tokens['currency'];


Do not forget to insert the click tracking code into your landing pages.

To insert it to your whole Teachable shop site navigate in your Teachable admin panel to Theme->Power Editor and under Templates->Layouts->Partials find footer.
Then get the actual click tracking code from your Post Affiliate Pro merchant panel Tools->Integration->Click tracking and insert it right above the line with </footer>

Add the same click tracking code also to Templates->Lectures->Partials->footer