Assuming you bought one with an oe connector (not crimp . soldiering), do you get the code immediately?
Otherwise, did you buy a NTK or Denso? At our shop, we always bought the oem manufacture for o2 sensors. If you bought, lets say the bosch sensor.. they sometimes won't cut it and keep dinging the light.