I am sorry your girl is having this issue. It may be her anal sacks becoming blocked:
It could also be a urinary tract infection.
You are absolutely correct to be concerned, Not only can recurring infections damage your baby's urinary tract but her immune system as well.
UTI's must be treated with an effective broad spectrum antibiotic like Clavamox or clidimycin and for a long enough duration so all bacteria is eradicated. If not, they will refluorish, stronger and more resistant and reinfect her. In addition, the bacteria can become tolerant of the same antibiotic so the medication should be varied for best results.
She should also be encouraged to drink as much as possible to keep the kidneys and bladder flushed. You can give her one daily drop of unsweetened (only) cranberry juice. That will reduce the PH of her urine and make her bladder inhospitable to UTI bacteria.
It is also possible these events may be triggered by stones or crystals. She should have a urine analysis so you will know for sure. Sometimes bacteria does not show up. If so she should still complete a round of antibiotics.
I would also check for sugar just to rule out diabetes.
Please let me know if you still have questions and how your baby is feeling. I will be happy to help further.
I hope she feels better very soon.