I’m creating a viral email feature – it creates a unique link using PHP: uniqid – Manual or something similar for users to share. The user is rewarded with free ‘credits’ when someone that clicks their unique link signs up.
My question: How do I track the user’s friend to the “sign up complete” page – so I can reward the user?
My best guesses: 1) set a cookie that recognizes when the user’s friend reaches the “sign up complete” page? 2) Or take user’s friend directly to sign up page, then parse link and place unique token in a hidden field in the sign up form. Example: http://FunNewSite.org/register.php?key=14usdijf8923u5
My question is similar to these: How to generate unique urls to track user signups?
rails beta request signup with social media sharing reward
But these answers don’t contain enough detail for me What is the best way for my app to recognize this new user’s sign up event?
Thanks in advance 🙂
Include the key in the URL like you showed above, then you can access it via PHP:
And print it in your HTML:
<input type="hidden" name="registration_key" value="<?php echo $key; ?>" />You can add any additional tracking logic as you see fit (for example, if you want to record that they started the signup but never completed it).
Then you’d just check when the sign in was sent to validate the key.
Edit
You could go the route of using cookies if you wanted to “remember” that the user clicked on a link a few days ago, and then came back to your site via direct entry and clicked the “sign up.”
Whether or not you want to credit that back to the referring user is up to you. But unless you want to do that, you don’t need cookies to accomplish this.