OK, I don't want to undermine anyone but as a mother of three who is almost finished with a degree in psychology, specialing in child development and family studies, we were taught to never never punish for these type things. Use positive reinforcement.
As a mom I can say I am guilty of punishing my kids when they had accidents, but the positive reinforcement worked much better. We made a big deal of it, clapped, praised and "had a poop in the potty party" when they went in the potty. When they had accidents, we would be very disappointed and tell them we were sad that they did not go in the potty like a big kid.
We used sticker charts and every time they went they got a sticker and when they went 10 times they got to pick something out of the treasure box. I had a metal lunchbox filled with stickers, small toys, candy, etc. and they got to pick what they wanted from it. Figure out something she really likes, as a reward and try to vary it so she doesn't get bored.
Good Luck.