Tracking inbound affiliate referrals

I’m trying to reward every referrer that refers to my app based on an action that a user takes (e.g. purchases a product).

The only simple way to achieve this at the moment is to create specific coupon codes that the referrer will share with its users. Every time that a user purchases with that coupon code, I will recognize a fee to the referrer.

However, this approach poses a few challenges. What if the user lands to my app through the referrer but completes a purchase without the coupon code? I don’t want to be forced the use of coupon codes, as this might create checkout frictions.

Have you guys created a workflow that resonates with my use case?