Avoid all-purpose cleaner on your carpet. The spot cleaner should be intended for use on carpets only. All-purpose cleaners generally leave a trouble causing residue that is difficult to remove and causes re-soiling.
Do not use any canned foam cleaners on your carpet. The foaming agents generally leave a sticky re-soiling residue which is also difficult to rinse out of the carpet.