Diarrhea and constipation

My poor girl is either constipated or has diarrhea. Her anal glands get impacted so we are at the vet every 4 weeks to have them drained. I have tried Glandex chews, switching to grain free, mixing wet food with dry food, sensitive stomach from science diet, adding some probiotic yogurt, adding pumpkin puree, eliminating chicken,and nothing seems to be helping.😩 She acts completely normal not in any pain. Vet recommended Rx dog food. Has anyone else had this issue and found the Rx to help? I was thinking maybe it could be allergies but everything we have added or removed from her diet has not made any difference.