Properly calculate referral amount for conversion script