In my world, with a 4 yr old, a 2 yr old, 2 dogs and a husband, the carpeting takes a beating. A "recipe" for an inexpensive carpet cleaner was given to me by a friend who runs a pet sitting business. In a spray bottle, mix together 4 parts hydrogen peroxide to 1 part ammonia. Spray on and scrub with a small brush. ( I actually use a nail brush) Let the area dry. I only have had to repeat this in an area one time, when the 4 yr old mashed a peanut butter cup into the carpet an undetermined amount of time beforehand. This is a dream for getting out the Georgia red clay stains!
For other great ideas, check out Rocks in My Dryer!