A set of density-functional theory based tools is employed to elucidate the influence of chemical and surface-induced changes on the core level shifts of X-ray photoelectron spectroscopy experiments. The capabilities of our tools are demonstrated by analyzing the origin of an unpredicted component in the N 1s core level spectra of metal phthalocyanine molecules (in particular ZnPc) adsorbed on Cu(110). We address surface induced effects, such as splitting of the lowest unoccupied molecular orbital or local electrostatic effects, demonstrating that these cannot account for the huge core level shift measured experimentally. Our calculations also show that, when adsorbed at low temperatures, these molecules might capture hydrogen atoms from the surface, giving rise to hydrogenated molecular species and, consequently, to an extra component in the molecular core level spectra. Only upon annealing, and subsequent hydrogen release, would the molecules recover their nominal structural and electronic properties.