I'm having trouble figuring out how to name the chord in the third measure below. I initially guessed G7sus2 which would make a recognizable IV-V-I cadence, but then I am unsure how to analyze the preceding E7 which I thought was a secondary dominant with respect to A major.
[Please disregard playability/voicing etc. this is just a transcription sketch.]