Remove as much of the solids as possible then blot with a paper towel until the carpet is touch dry. Sprinkle bicarb over the area. Then wring out a cloth in white vinegar and sponge the bicarb off.
If your dog eats commercial food, it will have a high caramel content to colour the food so you’ll need to wipe the area with glycerine first. Just apply a small amount of glycerine to a cloth and wipe over the area.
Fill a bucket with cold water and enough dishwashing liquid to create a sudsy mix. Use just the suds, not the water, and work them into the stain with a soft nylon brush. Leave to dry or use paper towel to absorb the moisture. When dry, vacuum. If there’s any unpleasant odour, repeat this process.
An alternative method is to apply cold water and dishwashing liquid suds with an old toothbrush, using as little water as possible. Then fill the bucket with warm water and dishwashing liquid and again apply the suds to the stain with an old toothbrush. The reason you use both cold and warm water is because faeces contain proteins and fats. Cold water removes proteins and warm water removes fats. You must clean in this order or the warm water will set the protein stain. Dry with paper towel.