She could have a weak sphincter(sp?) muscle. Or a lower spine problem(unlikely). Some vets will try giving meds for urinary incontinence, as I don't think there is meds. for sphincter? BUT-I am not a vet. I would consult the Vet.You could also try giving her larger meal earlier, or just little meals through the day,then take her out. In the meantime put a puppy pad under when she sleeps.
So Louie used to sleep in the bed with us and every now and then I would find a little turd that I was also sleeping with. I have no idea why one would sometimes pop out of his butt. It was never a full poop, just a small little turd. He started sleeping on the couch a couple years ago and I have never found any surprises there.