How do you do connect an app referral/link to an App download?


Is there a pattern or a best practice for app referrals?

I’d like to let a user invite other users by sending a link to the app on the AppStore, but I’m not sure how to connect a subsequent app download to that link/user. I’d like to connect the 2 users within the app.