Is there a connection between bubble baths and urinary tract infections (utis)?

Yes. Bubble baths/scented shampoos/ dirty bath water all have been linked to uti's in females from toddlers to adults. These agents can trigger irritation directly or leave a soapy film on female genitals. If not well rinsed, it may remain & trigger itching/redness/drainage. Bacteria may accompany the irritation & make the short trip to the bladder. I rarely see it in males, different parts.
Yes. Bubble-bath use is responsible for many utis. Bubble-bath with a little water can travel up a female urethra. This causes irritation and possible inflammation of the urethra and bladder, this damages protective layer of urethra and bladder lining so bacteria can attach to + invade bladder lining cells and a UTI results. More common in little girls than mature women. Bb should carry warning re utis.