How can I assign a unique identifier for first-time visitors on a website?

Well if I am not entirely mistaken you should be able to do that out of the shopify box.

  1. Make a segment of customers who never bought anything so far

https://help.shopify.com/en/manual/customers/customer-segmentation

  1. Make a discount available only to this segment.

  2. charge your customer for great consulting effort :slightly_smiling_face: