Abstract: The present invention relates to a computer implemented method for controlling a gas detector, a gas detector, a control system for detecting an incontinence event, and a computer implemented method for detecting an incontinence event. The method for controlling a gas detector comprises receiving a plurality of datasets from the gas detector. Each dataset is associated with a time interval and comprises at least one environmental measurement; and at least one detected level of ammonia. The method comprises receiving one or more user measurements, where a user measurement comprises an incontinence state determined at a particular time. The method comprises determining criteria to identify an incontinence event, using the received plurality of datasets and the received user measurement; and transmitting the criteria to the gas detector. The criteria define a characteristic of a subset of data of the plurality of datasets indicating an incontinence event.