On the way; while going somewhere — often used adverbially as 'on one's way (to...)', indicating doing something en route.
行きがけにコンビニで飲み物を買ってきてください。
Please buy a drink at the convenience store on your way.
学校へ行きがけに友達に会った。
I met a friend on my way to school.
行きがけの電車で読書をすることが多い。
I often read on the train while on the way.