Affiliate sales tracking

i created a site that generate affiliate link but it failed totally to capture sales and clicks on the genreted unique affiliate link inorder to display it in the affiliate dashboard

How is your affiliate tracking set up?

The general approach is:

  • create a URL with a tracking param like ?aff=12341234
  • in middleware, look for that param and mark something on the user’s account
  • when the user makes a purchase, check their account to see if they were brought in by an affiliate link