A few months ago my DS (and I - well I can't heap all the blame on a 2yo) spilled a large bottle of bubble mixture on the dark beige carpet.
Thought I had cleaned it up OK using vanish at the time but it soon turned into a dark mess that got blacker and blacker. So I spent ages cleaning it up again with vanish again but lo and behold it turned into a black mess over time.
I think that the bubble solution has made the carpet area sticky and so any particles around get trapped and so a nasty looking black mark builds up.
I know life is too short to worry about a perfect carpet but it looks truly dreadful and would love to get rid of it once and for all.
No the difference between bubble mix and just sodium laureth sulphate (the stuff in washing up liquid which makes bubbles) is that sugar is added to increase viscousity (thickness) that's what makes the bubbles last you see.
The sugar is the problem because it bonds with dirt and it decays, and if you leave it a few more weeks will probably attract ants!
If swabbing it with hot soapy water doesn't work you may want to hire a carpet cleaner or a steam cleaner to blast it out.