I set something like this up based on Robinhood’s list when my app was in beta. The key here is that you don’t need to track when the link is shared, just when people sign up from the link.
You’ll need to set your landing page for people who click the link to type “User”. You’ll also need to create a field that is a list of users to record people who sign up with the link. Then you can have your social share links contain the sharing user’s unique id. When the user’s friend clicks the link and signs up, store the new user to the Current Page User’s list of users.
If you want to show who’s ahead/behind a user, you can just run a search for users who’s list of users is larger/smaller and sort by creation date.