The present disclosure involves a method of measuring a physiological feedback from a patient in response to electrical stimulation. A stimulation parameter of a sacral nerve stimulation therapy is ramped up. The sacral nerve stimulation therapy includes electrical pulses generated by a pulse generator based on programming instructions received from an electronic programmer. The electrical pulses are delivered to a patient via a stimulation lead that is implanted in the patient. Via an anal electrode device that is at least partially inserted inside an anal canal of the patient, a compound motor action potential (CMAP) is measured from an anal sphincter of the patient while the stimulation parameter of the sacral nerve stimulation therapy is being ramped up. A stimulation threshold is determined based on the measured CMAP.