The truth behind a dogs wagging tail
A dog’s tail is used as a form of communication depending on where the tail is, if the tail is stiff, and even in which direction predominantly the tail is moving. People often assume that a wagging tail means a friendly dog, whereas this is far from the truth. Different breeds do have different size tails, for example:
“Most dogs have a “natural” tail that hangs down to somewhere near the hock (the joint between the lower thigh and the pastern on the rear leg). Others, such as the pug, have tails that curl up and over their backs. A few breeds, like the greyhound and whippet, have a tail that naturally tucks slightly between their rear legs. And some breeds have naturally short bobtails or have tails that were surgically docked. (For example, Australian shepherd puppies may be born with natural bobtails, and the Doberman pinscher is a breed that often has the tail surgically docked.)” ASPCA 2015 
The position of the tail is important to what the dog is communicating, for example:
“The tail’s position-specifically, the height at which it is held-can be considered a sort of emotional meter. A middle height suggests the dog is relaxed. If the tail is held horizontally, the dog is attentive and alert. As the tail position moves further up, it is a sign the dog is becoming more threatening, with a vertical tail being a clearly dominant signal meaning, “I’m boss around here,” or even a warning, “Back off or suffer the consequences.”
As the tail position drops lower, it is a sign the dog is becoming more submissive, is worried or feels poorly. The extreme expression is the tail tucked under the body, which is a sign of fear, meaning, “Please don’t hurt me.” Coren S 2011 
As well as this;
“The speed of the wag indicates how excited the dog is. Meanwhile, the breadth of each tail sweep reveals whether the dog’s emotional state is positive or negative, independent from the level of excitement.
As a result, there are many combinations, including the following common tail movements:
- A slight wag-with each swing of only small breadth-is usually seen during greetings as a tentative “Hello there,” or a hopeful “I’m here.”
- A broad wag is friendly; “I am not challenging or threatening you.” This can also mean, “I’m pleased,” which is the closest to the popular concept of the happiness wag, especially if the tail seems to drag the hips with it.
- A slow wag with tail at ‘half-mast’ is less social than most other tail signals. Generally speaking, slow wags with the tail in neither a particularly dominant (high) nor a submissive (low) position are signs of insecurity.
- Tiny, high-speed movements that give the impression of the tail vibrating are signs the dog is about to do something-usually run or fight usually. If the tail is held high while vibrating, it is most likely an active threat.” Coren S 2011 
Interestingly there has been scientific research showing that depending on which direction the dog is predominately wagging dictates if the dog is feeling positive or negative.
“Giorgio Vallortigara, a neuroscientist at the University of Trieste in Italy, and two veterinarians, Angelo Quaranta and Marcello Siniscalchi, at the University of Bari published a paper describing this phenomenon in the journal Current Biology. The researchers recruited 30 family pets of mixed breed and placed them in a cage equipped with cameras that precisely tracked the angles of their tail wags. Then they were shown four stimuli in the front of the cage: their owner; an unfamiliar human; a cat; and an unfamiliar, dominant dog.
When the dogs saw their owners, their tails all wagged vigorously with a bias to the right side of their bodies, while an unfamiliar human caused their tails to wag moderately to the right. Looking at the cat, the dogs’
tails again wagged more to the right but more slowly and with restrained movements. However the sight of an aggressive, unfamiliar dog caused their tails to wag with a bias to the left side of their bodies.” Caron 2011