You don't need to link it to any customer details. The way it usually works is the website records every serial number checked, and warns you if somebody has already checked that serial number. For additional assurance the serial number can also be concealed with tamper-evident packaging, e.g. scratch-off paint.
D’Addario has a “serial number” check webpage for their guitar strings. If you enter an invalid (or previously used) serial number, supposedly (I’ve never had a counterfeit set) they’ll send you a genuine set for free.
Sure, some people will input fake serial numbers to get a free product, but they probably weighed the cost of counterfeit strings affecting brand image (if I don’t know mine are counterfeit, I’ll assume it’s D’Addario’s fault if they’re bad) with the cost of sending a free set of $5 strings.