I have never had a problem except a few puppy piddles. What i did is take them out constantly. It will probably be different for an older puppy, but I watch them most often in the morning right after they eat, and several times during the day. I dont even give them a chance to pee on the carpet.

The peeing on the ground or herself when excited is something I haven't really tried to work with, as the only dog that I have that does it is a toy poodle, and he barely squirts.