Monday, November 27, 2023

Creating affiliate links

We want our existing customers to invite new customers and benefit from it. We have to track which new customer was referred to by an existing customer. We can do this by creating affiliate links of the form:
https://yourwebsite.com/registration?ref=userID
Code changes in backend:
  1. After registration, show invitation link on customer page with information text.
  2. On registration form, check ref=userID and after completion of registration, store registered userID in database customer table invitedCustomers column. This column can have multiple userIDs, separated by commas, but cannot have duplicates.
  3. Order data structure: Add referringUserID
  4. On product checkout, if current vendor userID is found in customer table-column invitedUserID, set order referringUserID to that rows userID.

No comments:

Post a Comment