Possibly from the French, 'en gogues' = 'in mirth'. If that is the source it crossed the English Channel very early. The first reference to 'agog' in English is Nicolas Udall's Apophthegmes, that is to saie, prompte saiynges (First gathered by Erasmus 1542):
"Beeying set agog to thinke all the worlde otemele."
The first sighting of 'all agog' is in William Cowper's The diverting history of John Gilpin, 1782:
"Six precious souls and all agog To dash through thick and thin."