Wag
Middle English (as a verb): from the Germanic base of Old English wagian ‘to sway’.
wiktionary
From Middle English waggen, probably from Old English wagian(“to wag, wave, shake”) with reinforcement from Old Norse vaga(“to wag, waddle”); both from Proto-Germanic *wagōną(“to wag”). Related to English way.
The verb may be regarded as an iterative or emphatic form of waw(verb), which is often nearly synonymous; it was used, e.g., of a loose tooth. Parallel formations from the same root are the Old Norsevagga feminine, cradle (Swedish vagga, Danish vugge), Swedish vagga(“to rock a cradle”), Dutch wagen(“to move”), early modern German waggen (dialectal German wacken) to waver, totter. Compare waggle, verb
etymonline
wag (v.)
early 13c. (intransitive), "waver, vacillate, lack steadfastness," probably from a Scandinavian source (compare Old Norse vagga "a cradle," Danish vugge "rock a cradle," Old Swedish wagga "fluctuate, rock" a cradle), and in part from Old English wagian "move backwards and forwards;" all from Proto-Germanic *wag- (source also of Old High German weggen, Gothic wagjan "to wag"), probably from PIE root *wegh- "to go, move, transport in a vehicle."
Transitive meaning "move (something) back and forth or up and down" is from c. 1300; of dogs and their tails from mid-15c.: "and whanne they [hounds] see the hure maystre they wol make him cheere and wagge hur tayles upon him." [Edward, Duke of York, "The Master of Game," 1456]. Related: Wagged; wagging. Wag-at-the-wall (1825) was an old name for a hanging clock with pendulum and weights exposed.
wag (n.1)
"person fond of making jokes," 1550s, perhaps a shortening of waghalter "gallows bird," person destined to swing in a noose or halter, applied humorously to mischievous children, from wag (v.) + halter. Or possibly directly from wag (v.); compare wagger "one who stirs up or agitates" (late 14c.).
wag (n.2)
"act of wagging," 1580s, from wag (v.).