The business can ask customers. There are ways to track Yelp attribution using tracking URLs and other means, but asking how a customer found a business is tried and true. Some restaurants will ask during the reservation process.