This song has some complexities for sure. From a high level, I would say this song is in D major. Though, as you suggest, it does follow the chords very closely and there are definitely some micro modulations going on.
If the question is which key to improvise in, I don't think you'll be able to stick with a single key. I guess it sort of switches between D and A major in the verse and chorus respectively. But following the changes very closely is probably going to be your best bet on this one.
@goodsided, credit card?