Maggie often did it when she was excited (like on the scales at the vet's office!!
Anal glands hold the dog's 'personal' scent, and usually empty when the dog is poo-ing; It lets all the other dogs KNOW who they are. Skunks also have anal glands which hold their 'personal' scent.....what grows in those glands is beyond description.
I hope she doesn't develop problems.....because expressing glands is a test of one's gag reflex