tag (n.1)youdaoicibaDictYouDict[tag 词源字典]
"small, hanging piece from a garment," c. 1400, of uncertain origin but probably from a Scandinavian source (compare Norwegian tagg "point, prong, barb," Swedish tagg "prickle, thorn") and related to Middle Low German tagge "branch, twig, spike"), from Proto-Germanic *tag-. The sense development might be "point of metal at the end of a cord, string, etc.," hence "part hanging loose." Or perhaps ultimately from PIE *dek-, a root forming words referring to fringe, horsetail, locks of hair" (see with tail (n.1)).

Meaning "a label" is first recorded 1835; sense of "automobile license plate" is recorded from 1935, originally underworld slang. Meaning "an epithet, popular designation" is recorded from 1961, hence slang verb meaning "write graffiti in public places" (1990).[tag etymology, tag origin, 英语词源]
tag (n.2)youdaoicibaDictYouDict
"children's game," 1738 (in reference to "Queen Mary's reign"), perhaps a variation of Scottish tig "touch, tap" (1721), probably an alteration of Middle English tek "touch, tap" (see tick (n.2)). Baseball sense is from 1912.
tag (v.1)youdaoicibaDictYouDict
"to furnish with a tag," late 14c. (implied in tagged), from tag (n.1). Meaning "go along as a follower" is from 1670s; sense of "follow closely and persistently" is from 1884. Related: Tagging. Verbal phrase tag along is first recorded 1900.
tag (v.2)youdaoicibaDictYouDict
"a touch in the game of tag," 1878; in baseball, 1904, from tag (n.2); the adjective in the pro-wrestling sense is recorded from 1955. Related: Tagged; tagging.