First get her checked for an UTI
Before meeting people, have her completely void her bladder. Have the stranger give her treats when she acts confident and greets properly. Ignore her when she pees. Don't raise your voice or correct. Ignore the behavior, reward the desired behavior. Be sure to socialize her well - different types of people, places, situations.