I had a Great Dane that did that. He couldn't tell if he had to poop. The vet found he had some nerve damage on his spine--inoperable. Great Dane's don't have a long life expectancy--this happened late in his life. It was easy to clean up--never messy, very solid. We just kept an eye on him and cleaned it up when it happened. You can always get new carpeting or have the carpets cleaned professionally after she passes away--which is what we did. As long as she is in no pain as ours wasn't--you can replace/clean the carpet, but cannot replace her. Whatever you do (as you said)--do not yell at her--she probably feels bad enough. BTW--our house is very clean--not immaculate, but clean. I just happen to feel my dogs are members of my family.
There are also female and male diapers available at PetSmart, Pet Depot, and other pet stores for dogs that lose control. My dog would not tolerate them--so I didn't use them, just cleaned up afterwards.
Good luck at the vet's--I hope it's nothing serious with her.