Method for operating an injection valve, the injection valve comprising a valve body with a cavity comprising a fluid outlet portion, a valve needle movable in the cavity and preventing a fluid flow through the fluid outlet portion in a closing position and releasing the fluid flow through the fluid outlet portion in further positions, and an actuator unit with a coil and an armature, the armature being movable in the cavity and being designed to actuate the valve needle, the method comprising the following steps: - actuating the actuator unit by means of a predetermined voltage signal starting at a given starting time (T_0), - recording a time-dependent profile of a current through the actuator unit, - based on the recorded profile of the current and starting from the starting time (T_0) detecting a first gradient alteration time (T_1) where the gradient of the recorded profile of the current changes more than a first given threshold, the gradient between the starting time (T_0) and the first gradient alteration time (T_1) being representative for the energization of the coil, - based on the recorded profile of the current and starting from the first gradient alteration time (T_1) detecting a second gradient alteration time (T_2) where the gradient of the recorded profile of the current changes more than a second given threshold, the gradient between the first gradient alteration time (T_1) and the second gradient alteration time (T_2) being representative for a movement of the armature alone, - based on the recorded profile of the current and starting from the second gradient alteration time (T_2) a third gradient alteration time (T_3) is detected where the gradient of the recorded profile of the current changes more than a third given threshold, the gradient between the second gradient alteration time (T_2) and the third gradient alteration time (T_3) being representative for a common movement of the armature and the valve needle, and - dependent from the first gradient alteration time (T_1) and/or the second gradient alteration time (T_2) and dependent from the third gradient alteration time (T_3), determining a diagnostic value, and - using the diagnostic value for compensating a long-term drift of the injection valve. - actuating the actuator unit by means of a predetermined voltage signal starting at a given starting time (T_0), - recording a time-dependent profile of a current through the actuator unit, - based on the recorded profile of the current and starting from the starting time (T_0) detecting a first gradient alteration time (T_1) where the gradient of the recorded profile of the current changes more than a first given threshold, the gradient between the starting time (T_0) and the first gradient alteration time (T_1) being representative for the energization of the coil, - based on the recorded profile of the current and starting from the first gradient alteration time (T_1) detecting a second gradient alteration time (T_2) where the gradient of the recorded profile of the current changes more than a second given threshold, the gradient between the first gradient alteration time (T_1) and the second gradient alteration time (T_2) being representative for a movement of the armature alone, - based on the recorded profile of the current and starting from the second gradient alteration time (T_2) a third gradient alteration time (T_3) is detected where the gradient of the recorded profile of the current changes more than a third given threshold, the gradient between the second gradient alteration time (T_2) and the third gradient alteration time (T_3) being representative for a common movement of the armature and the valve needle, and - dependent from the first gradient alteration time (T_1) and/or the second gradient alteration time (T_2) and dependent from the third gradient alteration time (T_3), determining a diagnostic value, and - using the diagnostic value for compensating a long-term drift of the injection valve.