We fabricate metal/LaAlO3/SrTiO3 heterostructures using a combination of pulsed laser deposition and in situ magnetron sputtering. Through magnetotransport and in situ X-ray photoelectron spectroscopy experiments, we investigate the interplay between electrostatic and chemical phenomena of the quasi two-dimensional electron gas formed in this system.