Is there a way to track subscriber source for affiliate

Is there a way to track subscriber source for affiliate purposes? "Invite Codes" might be the ticket... but then how would we track for future revenue sharing/commissions?

I'll be offering Free Lifetime Membership at a specific subscriber level which looks like can be easily done with coupons... but I hoped to tie it to referrals E.g. Two email referrals equal "free"

Thank you in advance...