How to programmatically check whether a customer is new or returning?