In this paper we classify the magnetic trajectories corresponding to contact magnetic fields in Sasakian manifolds of arbitrary dimension. Moreover, when the ambient is a Sasakian space form, we prove that the codimension of the curve may be reduced to 2. This means that the magnetic curve lies on a 3-dimensional Sasakian space form, embedded as a totally geodesic submanifold of the Sasakian space form of dimension (2n + 1).