The stains are generally caused by water getting into the backing board (plywood, hardboard etc) and bringing the chemicals from that into the carpet. That's why the clean rainwater stains brown in most cases.
Therefore it is imperative that you don't get the carpet too wet or it will simply bring more and more back (ask me how I know LOL)
I found that applying the cleaner (in my case Oxyclean I mixed very strong myself) to a decent kitchen towel (I use Viva) and then blotting the carpet - apply pressure for a minute of so and then finish with a dry cloth, works best.
It takes several applications but works great in the end.