We report on the measurement of the spin density matrix elements in $W$ pair production in bins of the cosine of the production angle of the $W^-$ boson. The imaginary part of the off-diagonal matrix elements are sensitive to CP and CPT violating contributions to the production amplitudes. From an analysis of the matrix elements, limits on anomalous CP violating gauge couplings are derived.