This paper describes a procedure for quantifying and compensating for angular offsets and slow-varying drifts associated with a flux-gate magnetometer onboard a spinning spacecraft. Such magnetometers have been flown on numerous spacecraft such as IMP-8, DE-1, and ISTP/GEOTAIL, and similar instruments are currently proposed to fly on the ISTP/WIND spacecraft. Consequently, slight geometric misalignment of the sensor from their chosen axes will create errors in the measured signal. These misalignments can be quantified using perturbation theory and compensated in the data analysis process. The technique is applicable to magnetometers on spinning spacecraft. Also, over long time periods, the magnetometer will develop slight drifts in the electronic components, and these too can be quantified in the data analysis process. We shall discuss a technique that quantifies and compensates for such perturbations from the measurements. The technique has been successfully applied for the last sixteen years to IMP-8 magnetometer data and more currently to the GEOTAIL magnetometer data, and can be applied in a general way to measurements from any magnetometer onboard a spinning spacecraft. Further improvements in the technique will also be discussed.