I have a very light carpet, and have had to over the years clean it due to uh-ohs. I go around to the spots and treat them with simple green. I spray a lot on, rub it in with my fingers, and let it sit for 15-20 minutes. Then I mix baking soda and vinegar with warm water in my shampooer and go over the carpet several times. The important thing to note is that anytime you use any kind of shampoo, the suds remain on the carpet if not rinsed thoroughly and the shampoo stuck in the carpet will attract stains easier. The vinegar helps to pull the soap from the simple green out of the carpet so no foam/residue will remain, and the baking soda is a good deoderizer that is not toxic to pets like some store bought brands can be.
The important thing to do when it comes to new stains is to blot up as much of it as you can with a towel and spray it with a carpet cleaner spray, or simple green, immediately. Then get out that trusty shampooer and go over the spot over and over until cleaner and foam free.
Good luck, I hope this works for you as it has for me.