I know you've seen it from time to time. The dog is scooting its butt along the floor. It looks funny but at the same time your disturbed their doing it. As my husband would say, their using our carpet as toilet paper.
So Why Do Dogs Have Anal Glands?
Glad you asked, it's simply for one thing...scent recognition. When your dog sniffs another dogs rear they have their own distinct odor "their signature or name if you will". Dogs smell and say "hey I know you" or "your new".
Why Do Dogs Scoot?
Typically it's the dog trying to release the overflow of pressure build up they feel in their anal glands. Dogs can not contract their muscles at will in this area but each time they have a bowel movement, a little fluid is squeezed out as the anus pushes. Unfortunately, there are times when the anal fluid is too thick to flow out properly which causes a blockage thus causing the build up of pressure to start and become more uncomfortable for the dog thus you get the dog scooting its rear end. There are some dogs that instead of scooting they will lick to try to elevate the discomfort. More often, the small breeds suffer the most with this problem but at times large dogs have the issue as well.
Empty Or Not To Empty.
I recommend only to emptying the sacs if your pup has symptoms. If there isn't any evidence of a problem then leave them alone. If you don't know what your doing you could cause damage which could lead to other issues. In my opinion, it is best to leave it to a professional like your vet.
I'm thankful that us as humans don't have these glands. I'd have no friends or family as there would be no way I'd be willing to sniff your butt to say hello.