We construct a path-integral representation of the generating functional for the dissipative dynamics of a classical magnetic moment as described by the stochastic generalization of the Landau-Lifshitz-Gilbert equation proposed by Brown, with the possible addition of spin-torque terms. In the process of constructing this functional in the Cartesian coordinate system, we critically revisit this stochastic equation. We present it in a form that accommodates for any discretization scheme thanks to the inclusion of a drift term. The generalized equation ensures the conservation of the magnetization modulus and the approach to the Gibbs-Boltzmann equilibrium in the absence of non-potential and time-dependent forces. The drift term vanishes only if the mid-point Stratonovich prescription is used. We next reset the problem in the more natural spherical coordinate system. We show that the noise transforms non-trivially to spherical coordinates acquiring a non-vanishing mean value in this coordinate system, a fact that has been often overlooked in the literature. We next construct the generating functional formalism in this system of coordinates for any discretization prescription. The functional formalism in Cartesian or spherical coordinates should serve as a starting point to study different aspects of the out-of-equilibrium dynamics of magnets. Extensions to colored noise, micro-magnetism and disordered problems are straightforward.