Promo Code Variables? For Referral Tracking

I’m trying to set up a referral program with promo codes that rewards affiliates commissions while also giving their buyers discounts. The referral platform I’m using requires the variables for promo codes to be available on the “Thank You” page in order to track affiliate sales. Unfortunately, the default “Thank You” page does not have much on it. Can anyone help please?