When dogs shake due to excitement it helps to lower their excess energy and keep them more contained. Most commonly it's seen in younger dogs as they tend to have weaker impulse control, and it's usually a good idea to pay less attention to them until they calm down, then reward them with a calm stroke.