Last year my son dropped a full ketchup bottle (giant size 100% extra free) on the carpet. The ketchup went everywhere!!!!
Everytime I thought I'd cleaned it up, the following day the stain (the stain was the size of a US state) would reappear. I guess the stickineess clung to the fibres and so attracted any kind of dirt.
I ended up getting rid of the carpet (now have wood)
If nothing else works, and I agree with nailpolish, 1001 is good, it may be an idea to hire a carpet cleaner.
If you mix up some Dreft (IFAIK - has to be Dreft as that is for wool) with water and squirt it on and rub it in well with just your fingers, otherwise you'll change the texture of your carpet. Hopefully that should do the trick.
Lakeland do some fantastic wipes for getting stains off carpets - called Wipe Off - sorry I can't make a link work - but go to www.lakelandlimited.com and search on Stain and they come up on second page (£2.95 a pack and they are fantabulous !)
I have definitely got ketchup off a cream carpet with them and red wine !!