A method and device for electrically stimulating one or more structures in the gastrointestinal tract as described. The one or more structures are preferably selected from the upper esophageal sphincter, the esophagus and gastric fundus. The method may involve the step of arranging a plurality of stimulating electrodes adjacent one or more structures which may further include the lower esophageal sphincter, the stomach, the pyloric sphincter, the small intestine, the colon and the vagus. The method and device may further include sensing electrodes to detect change in one or more physiological parameters in the gastrointestinal tract and modulate the stimulating electrodes in response to the change. The device comprises a pulse generator, a power source, a plurality of stimulating electrode set, one or more sensing electrodes and means for varying activity of the stimulating electrodes in response to change detected in the gastrointestinal tract. The method and device may be used to treat obesity and / or GERD.