Install on Teachable
Head snippet for click capture, plus a Liquid block on each Thank You page for the conversion event. Heads up that Teachable's head snippets don't run on the checkout subdomain, so affiliate links need to route through your marketing pages first.
Teachable's tracking install has two parts: a global head snippet on your school subdomain, and a per-course Liquid block on the Thank You page that fires the convert event. One critical detail: Teachable's head snippets do not run on sso.teachable.com or the checkout itself, so affiliate links have to route through a Teachable marketing page (course sales page) before the buyer hits checkout, not directly into a checkout URL.
Prerequisites
You need at least Teachable's Builder plan or higher. The Basic plan does not expose the Site > Code Snippets section needed for global head install.
Install the head script
Step 1. In Teachable admin, navigate to Site > Code Snippets > Global Head Snippets.
Step 2. Paste the Rekomi head script:
<script>
(function(){
var s=document.createElement('script');
s.src='https://js.rekomi.com/v1/rekomi.js';
s.async=true;
s.dataset.programId='YOUR_PROGRAM_ID';
document.head.appendChild(s);
})();
</script>Save. Your program ID lives in Rekomi at Settings > Tracking.
Route affiliate links through your marketing pages
Teachable's Global Head Snippets do NOT execute on sso.teachable.com (the login/checkout subdomain). If an affiliate sends a visitor directly to a Teachable checkout URL, the head script never runs, the click cookie never sets, and attribution fails silently.
Solution: Every affiliate link points to a Teachable marketing page (your course sales page, your school homepage, a custom landing page) where the head script DOES run. The buyer clicks through to checkout from there, and the cookie carries through the same browser session.
In Rekomi's affiliate dashboard, the default tracking URLs route to your school's main domain (e.g., https://courses.yourbrand.com/?via=SLUG), not to a checkout URL. Affiliates copy this link directly. Do not rewrite the destination to a checkout URL for "shortcut" reasons; it breaks attribution.
Fire the conversion on the Thank You page
Teachable lets you customize each course's post-purchase page through Liquid/HTML blocks.
Step 1. In Teachable admin, open Course > [your course] > Settings > Thank You Page.
Step 2. On the Purchase Confirmation block, click Insert new block > Add Liquid/HTML Block.
Step 3. Paste the convert snippet:
<script>
window.Rekomi && window.Rekomi.convert({
external_event_id: '{{customer.id}}-{{course.id}}',
amount_cents: 4900,
currency: 'USD',
customer_email: '{{customer.email}}',
});
</script>Replace 4900 with the course's price in cents ($49 in this example). Teachable does not expose course price as a Liquid token, so the price is hard-coded per course. If you sell at multiple price points (sales, discounts), maintain the hard-coded amount per Thank You page, or render the snippet server-side from your fulfillment webhook with the actual paid amount.
The external_event_id combines customer id and course id so a single customer buying two courses gets two distinct conversions, not a de-duped one.
Repeat this step for every course you sell.
Refund handling depends on your billing mode
Teachable supports two billing modes, and the refund flow differs.
Teachable:Pay (Merchant of Record, US-only). Teachable is the merchant; refunds do NOT fire charge.refunded on your Stripe (you don't have one connected for this mode). To clawback commissions on refunds, subscribe to Teachable's refund webhook (admin > Settings > Webhooks), and forward refund events to Rekomi's /api/tracking/refund endpoint with the matching external_event_id from the original conversion.
Stripe Connect billing. Refunds fire charge.refunded to Rekomi's Stripe webhook listener and the clawback is automatic. No Teachable-side webhook relay needed.
To check which mode you are on: Teachable admin > Settings > Payments. Teachable:Pay is the default for US schools; Stripe Connect requires explicit setup with your own Stripe account.
Quirks worth knowing
No dynamic pricing in Liquid. Teachable does not surface {{course.price}} or equivalent in the Thank You page Liquid context. The convert snippet's amount_cents is hard-coded. If your course price changes (sales, upgrades), update the Thank You page block at the same time, or render the snippet server-side.
Head snippets do not run on the checkout subdomain. This is the single most common install bug. Always route affiliate links to a school-domain marketing page, not a checkout URL.
Custom domain vs *.teachable.com. If you are on a custom domain (e.g., courses.yourbrand.com), the head script runs there as expected. If you serve directly from *.teachable.com, the same applies. The exclusion is only sso.teachable.com and the bare checkout subdomain.
Multiple Thank You pages per course. Some advanced configurations have separate Thank You pages per pricing plan (monthly vs annual). Add the convert snippet to each, with the appropriate amount_cents for that plan.
Sales tax handling. Teachable's amount_cents should reflect what the affiliate earns commission on. If your commission base is the net (excluding sales tax / VAT), use the net amount in the snippet. If commission is on the gross (including tax), use gross. Be consistent across all Thank You pages.
Troubleshooting
No conversion fires after a Teachable purchase. First check: does the affiliate link route to a school marketing page (not a direct checkout URL)? If yes, second check: is the Thank You page Liquid block present on the specific course the affiliate sent traffic to? Each course's Thank You page is independent.
Wrong amount on the commission. The hard-coded amount_cents in your Thank You page block does not match the actual price paid (because of a sale, promo code, or plan tier difference). Update the block, or move to server-side rendering of the snippet from your billing webhook.
Refunds do not clawback on Teachable:Pay. Teachable:Pay does not route refunds through your Stripe, so the standard Stripe webhook rail does not fire. Set up the Teachable webhook relay (see "Refund handling depends on your billing mode" above) to /api/tracking/refund.
Customer id appears but no commission lands. The affiliate cookie was missing at the moment of checkout. The visitor probably reached a Teachable checkout URL directly (bypassing your marketing pages). Audit your link routing to confirm every affiliate link starts on a head-script-bearing page.
Related
Install on Podia
Two Podia text fields handle the entire install. Website tracking code carries the head script; Conversion tracking code fires the post-purchase event. No code outside Podia's admin.
Install on Thinkific
Use Thinkific's Site Footer Code (not Header) so the head script runs on the Course Player. Conversion fires on the Order Confirmation page via a Liquid block.