Unfortunatley, I know what you are going thru, my 11 year old son had this problem from potty training days to the age of 8 and my daughter is 15 months old and just now starting the exact same thing. With both of them, the symptoms were pretty much the way you described, here is what I can suggest, some of these things have worked for me at different times. When you notice they haven't gone in a day or so, you need to start the 100 % juices, if you find that these don't do the trick I would give her a teaspoon of the childrens laxative(over the counter) Fletcher's Laxative for Kids; original root beer taste. My pediatrician suggested this to us because it is natural and safe for children to take daily if needed. It smells horrible but my son loved it, now my daughter, I have to put it in a syringe and squirt it into the back of her mouth or she will spit it out.
If it is already too late for all that stuff, for instance, if you can see the stool stuck in her bottom, try very hard to get her to calm down...tell her it is very important for her NOT to push, even though she feels like it. If you can get her calmed down enough to where it goes back into the rectum, you could use a glycerin suppository or if it is really bad, you could use an enema, afterwards, let her sit in a very warm tub, deep enough to cover her tummy. The warmth of the water relaxes the bowels and it could come out easier or when she relaxes, the medicine you just inserted will be able to start working. Also, when I see that I am too late for all of that (I had this problem last night with my daughter) I had to quickly put gloves on and put vaseline all around her bottom to try to prevent her from tearing and then I had to manipulate the stool to try to help it come out without hurting her so bad, I have even used q-tips to remove some of the outer sides of the stool to make it smaller for her to pass, but the laxative we gave her, took over and her little body tensed up and she screamed, and it was out. I always examine it to see if maybe there was something in it that would have caused it. Her bottom was very swollen and sore and red, and she bled about 3 little drops. I use a hemmoroid ointment or "Aquaphor" on her after that.
Sorry if that grossed you out but if this keeps up with her, you will know what I am talking about very soon. Especially when your baby is crying for you to help her.
So, just remember, in summary: she should have at least 8 oz of 100 % juice every day, if that doesn't work, start giving her 1-2 tsp of the laxative every morning. If it has already started, sit in the warm tup, she could even drink something very warm...tea, hot chocolate, coffee, when she is calm use the glycerin supp. or the enema. You will find all that together at your drugstore, both are made for babies, toddlers and children. Hope that helps, if you come across something I didn't tell you, please pass it on.....