Our girl is 4 and she has anal gland problems too. It definately may be that. Take her to the vet or even a groomer and they will drain them. The smell will be gone for about a month. Some dogs have problems and some don’t. Ours does. Lol. Our groomer charges $5 to drain them.
Anyway, most likely that is your problem.