Living in a student apartment, our carpet was less than perfect when we moved in over a year ago. There have always been unknown dark stains around various places, but the worst of it was near the kitchen area. I thought they were just the kind of stains that would forever stay there. Through Pinterest, I saw a post from lizzy writes with this recipe for carpet cleaning. Tried it & it worked!
Sprinkle the area with baking soda ---> wait 10 minutes ---> vacuum it up. Mix together 2 cups of warm water, 1 tbs of clear dishwashing liquid & 1 tbs of white vinegar. Use a white towel to sponge on the mixture. Dab it on, more on the darker areas. Keep dabbing with dry parts of the towel until the area is mostly-dry. Wait a while for the area to dry more, then sprinkle on a little more baking soda and vacuum again.
It's still not close to perfection, but it is so much better. Our carpet is pretty terribly damaged overall, so if it can look this good for me, I bet simple stains will look great.