You are right – you have to use motion tracking. Unless its a steady panning motion – then it would easy to keyframe.
I can’t remember if there’s some help to get from after effects helpfile. Sorry I can’t be more precise but I’m not at a computer with after effects at the moment.