a device for detecting the operation of a dispenser includes a medium container for storing a dischargeable medium , a discharge mechanism operated by a relative movement between an operating element and the medium container , the operating element containing a detecting device for detecting operations which have taken place and for generating an electric counting signal in response thereto , the operating element also containing a display element for displaying a numerical value determined in the counting mechanism as a function of the number of counting signals which have occurred and the display element only being activated for a period of time .