My husband was good at tracking mud and oil into our carpet, until I finally made him clean it up. The stains were a nightmare. Not so much the mud, but the oil that he tracked in along with the mud sent me through the roof. I was tired of buying poisonous chemicals off the market shelf so I tried an old remedy from my ex-mother-in-law (clean-freak, yet great cook).
I used baking soda on the stains and sprinkled lemon juice onto the baking soda. Watch it fizz! It actually soaks up the substance. I tend to leave it overnight some times on tougher stains. Voila! The stain disappeared, the house isn't bombarded with bad fumes and no more head-bumps from the ceiling.