One thing I haven't seen mentioned — if you're replacing an encoder on a press that's been running for 5+ years, check the encoder cable flex point while you're in there. The cable bends slightly every stroke cycle, and after millions of cycles the shielding braid breaks internally even though the outer jacket looks fine. You won't see it visually but a megger test at 500V between shield and conductors will show it. We had a "new encoder" throwing intermittent faults for two weeks before we figured out the cable was the problem all along.
Also — on Fanuc motors specifically, the encoder mounting uses a spring-loaded coupling that self-centers. Do NOT tighten the mounting screws with the coupling compressed. Hand-seat it, let the spring find center, THEN snug the screws in a star pattern. Over-torquing pushes the encoder off-axis and you get a sinusoidal position error that shows up as a once-per-rev vibration at low speed. It'll pass the Fn008 zero-set just fine but the motor will sound terrible below 100 rpm.
ben_pressshop's runout check is spot on. I'd add: do the check at both ends of the coupling if your motor has a separate encoder bracket. We had a case where the bracket itself had a 0.02mm bow from a previous overtorque — encoder was perfectly mounted to a crooked bracket.