I have trained all my dogs to alert me to visitors using an extremely easy method. If someone comes to the door and the dog does not alert me (some dogs do naturally), I take the dog to the door with me. Once there, I start asking excitedly "who's there? who's there?". The dog will join in and start to bark. Once (s)he barks one time, I praise him/her; and, request a sit and quiet. As I am opening the door, I am praising the dog on sitting. If I hear another bark, I gently put my hand around the dog's muzzle while repeating, "quiet, quiet". The second (s)he stops barking, the praising begins.
Love and consistency wins out every time.