Okay, so there's a concept missing from this question which is the tonal center. That's just a fancy way of saying the root note, the note which all others gravitate to and resolve to, which would be A in the example of the chords you gave. Key is a bit more specific, and it is usually used to mean not only the tonal center but also the scale used to construct the song.
As you note, the key "A" doesn't seem to contain all of the possible notes/chords found in this song. That's fine. We can write a song in a particular key, but then add notes and chords not found in the key.
I think what you need to know right now is that it's OK to put chords and notes in a song that are not in the key. In fact, if you don't, some people might think it sounds a little bit boring.
I think it's helpful to start analyzing the chords and giving them a roman numeral function. This will help you identify stuff that's out of the key of A major, and how that works. (Just one note outside of the key is not always such a big deal, but when a whole chord leaves the key it tends to be more noticeable).
We do this by writing a roman numeral for the pitch. A is roman numeral I, G is roman numeral bVII and D is roman numeral IV. We can also indicate the type of chord this way. But they are already major chords, so no more information is needed:
A G D
I bVII VI
Now we can see the the song is "in A" but pivots off of the bVII chord.
If you want to analyze it further, you can look at the scales which the chords come from. You can say that the bVII chord comes from A mixolydian. In A major the notes are:
A B C# D E F# G# A and vii chord is G# B D, which is G#dim, a fairly uncommon chord.
In A mixolydian the notes are
A B C# D E F# G A and the VII chord is G B D, a regular major chord.
You can find a bVII chord in some other scales as well, but it's most often associated with the mixolydian mode.
Now, if you decide you feel that the song isn't really concerned with A major at all, but is actually written from A mixolydian, you might even say that the "key" of the song is "A mixolydian", not "A major". By the time you come to this realization, the difference doesn't really matter much. You can think about it either way, whichever suits you and makes understanding the song more convenient.
There's still much more we could say on the subject, but hopefully that answers the question.