Showing

Where do I put the script when my landing page and checkout are on different platforms?

Put the script on every page a visitor sees before they pay, starting with the landing page. It only rewrites Stripe Payment Link, Polar checkout, Gumroad and Lemon Squeezy links for you, so for any other jump to a different domain you have to carry the tc, aff and cid parameters across yourself.

4 min read
Updated Sep 14, 2026

Put it on the landing page, and on every page a visitor sees before they pay. The script reads tc and aff from the link the visitor arrived on and stores them in that browser, but the storage belongs to the domain that wrote it. It does not follow the visitor to a different domain on its own.

Tracking script (add before </head>)
<script src="https://www.linkjolt.io/api/tracking.js?id=YOUR_MERCHANT_ID"></script>

Your brand's tag, with your id already in it, is on the Integration Hub page.

What the script hands off for you

Once tracking is stored, the script rewrites four families of checkout link in place. It only touches real links, the <a href> kind, and elements set up for Polar's embedded checkout, so any other checkout your storefront opens with JavaScript is not one of them.

  • Stripe Payment Links, where the address is exactly buy.stripe.com. It adds client_reference_id holding the full tracking reference.
  • Gumroad, any gumroad.com address including your own store subdomain, plus gum.co. It adds tc, aff and cid.
  • Lemon Squeezy, any lemonsqueezy.com address including your store subdomain. It adds checkout[custom][tc], checkout[custom][aff] and checkout[custom][cid].
  • Polar, checkout links on buy.polar.sh, plus embedded checkouts that use Polar's data-polar-checkout attribute. It adds reference_id holding the full tracking reference, which Polar copies onto the order and every renewal.

A link that already carries the tracking parameter is left alone, and the script re-scans when new links appear, so links your page renders after load are covered too. Everything else is untouched: a self hosted checkout, a course or booking platform, a Stripe Checkout session your server creates rather than a buy.stripe.com link, and a Polar checkout your server creates through Polar's API.

Carry the parameters yourself for every other handoff

Three parameters matter. tc is the tracking code, aff is the affiliate id, and cid is the click id, which is only there when the visitor arrived through a link click. tc and aff are both required. Pass cid whenever you have it.

Read them on the landing page:

window.linkjolt?.getTrackingInfo() // { trackingCode, affiliateId, clickId } window.linkjolt?.referral // "tc_CODE_aff_AFFILIATE_cid_CLICK"

Then get them to the checkout one of two ways.

  1. The next page is yours. Add tc, aff and cid to the outbound link's query string, and install the same script tag on that domain so it reads them back and keeps the 30 day window running.
  2. The next step is a hosted checkout. Put the reference string into the field your processor sends back on its webhook. Stripe Checkout uses client_reference_id. Paddle uses customData with a linkjolt key. Polar uses metadata.reference_id.

If nothing carries across, the order arrives with no reference. LinkJolt falls back to a registered affiliate coupon if one was used, and if there is no coupon either, nobody is credited and the sale has to be entered by hand from the Commissions page with Add commission.

Subdomains count as a different platform

Moving from www.yourcompany.com to checkout.yourcompany.com is the same problem. The script writes host only cookies, and browser storage is per origin, so nothing kept on the first host is readable on the second. Treat that hop exactly like a hop to somebody else's checkout.

One tag per brand

The id in the tag is that brand's id, and it covers every campaign and affiliate under it, so use the identical tag on every domain in that funnel. If you run more than one brand, each has its own id and they are not interchangeable.

Test with a real affiliate tracking link, not a made up code. A code that matches no campaign is still stored in the browser, but the click is rejected, so the test looks healthier than it is. Walk the real path through to checkout and confirm the reference survived the last step.

For what happens after the order arrives, see "How does LinkJolt decide which affiliate gets credit for a sale?". If a handoff is impossible to instrument, coupon codes attribute without touching your checkout at all, covered in "How do I track affiliate sales without adding code to my checkout?".

Start your affiliate program

Launch in minutes with 0% platform fees. 7-day free trial, cancel anytime.