The trajectories of galaxies in groups: mass-loss and preprocessing