Scotchguard has been applied to carpeting for a long time, even re-applied by carpet cleaners after they finish. It is now 'reformulated', but I would guess still toxic:
"In May of 2000, 3M pulled Scotchgard stain protector and stain resistant fabrics from the market based on results from internal toxicity studies and mounting pressure from the U.S. Environmental Protection Agency. It was determined the main chemical compound present in Scotchgard products posed long-term, harmful damage to both humans and the environment."
hunker.com/13419876/alternatives-to-scotchgard