The useful window is after they have paid and left, or as they take the ticket. Google’s own suggestions are a QR on the receipt, a thank-you email, or the end of a chat you already have with them.
A spoken line at the door, in a rush, is easy to forget and easy to turn into pressure. Google does not want merchants to require or lean on people for a rating while they are still on the premises. A code they can scan later does the job without the lean.
Ask once. Use the same sentence for everyone. Do not say “if you enjoyed it.” That sentence is a filter, even if you did not mean it that way.
If the service was a disaster, you can still leave the Google link on the ticket, or you can ask nobody that day. What you cannot do is walk only the happy tables.
A simple pairing works in most shops: one quiet sentence at payment, and the QR already printed on the paper. They decide at the bus stop, not under your eye.