Website morphing infers latent customer segments from clickstreams and then changes websites' look and feel to maximize revenue. The established algorithm infers latent segments from a preset number of clicks and then selects the best “morph” using expected Gittins indices. Switching costs, potential website exit, and all clicks prior to morphing are ignored. We model switching costs, potential website exit, and the (potentially differential) impact of all clicks to determine when to morph for each customer. Morphing earlier means more customer clicks are based on the optimal morph; morphing later reveals more about the customer's latent segment. We couple this within-customer optimization to between-customer expected Gittins index optimization to determine which website “look and feel” to give to each customer at each click. We evaluate the improved algorithm with synthetic data and with a proof-of-feasibility application to Japanese bank card loans. The proposed algorithm generalizes the established algorithm, is feasible in real time, performs substantially better when tuning parameters are identified from calibration data, and is reasonably robust to misspecification.