All dogs have glands located just inside their anus. Referred to as anal or rectal glands, they are designed to add a liquid to your dog's poop. This liquid does the same thing as the urine, which is to mark her territory. In fact, the scent released by these glands is considerably stronger and more effective. The only problem is that these glands can become impacted, which requires you to massage them until the blockage is cleared out and the buildup of fluid inside is released. It might take you a few extra minutes to do this while you are learning, but once you have mastered the skill, it will take you less than five minutes.
Your dog probably doesn't even know she has anal glands. But what she does know, is that when they become impacted or infected, they can itch, burn, or simply be very painful. The easiest way to diagnose this condition is when your dog starts dragging her bum across the carpet, trying to scratch it and get at least some measure of relief. It is your job to recognize the signs and then help her by massaging the glands until they drain.
While impacted glands tend to affect smaller dogs more frequently, this problem can affect bigger dogs as well. You should be checking the glands regularly--the perfect time to do so is while you are giving her a bath. Take all the time she needs, be very gentle, and be free with treats as a reward for putting up with what you are doing.