it's almost always from the anal sacs, they would need to be expressed by a vet or groomer, you can learn to do it yourself, and they can probably show you how to, but it's really gross and can squirt SMELLY brown puss at you, most dogs can express them themselves during elimination, but some get stuck and have to have them manually expressed, almost all scooting is due to this happening and them trying to express them on your carpets, so hurry quick to a vet or groomer and have them checked!!!