Oxygen incorporation in MgB2 thin films during their fabrication process has a strong influence on the future properties of the films, and was studied by Elastic Recoil Detection Analysis with Heavy ions and a Time-of-flight detection. A series of MgB2 thin film samples were analyzed, including films produced in situ on Al2O3-C and Si (0 0 1) substrates (with higher T-c and lower T-c) with an "on-axis" geometry, and films produced in situ with an "off-axis" geometry. The amount of oxygen detected in these films appears to be correlated with the T-c of the films, the higher the T-c the lower the oxygen content. The superconducting properties of the examined thin films are discussed in the context of the ERDA results. (C) 2008 Elsevier B.V. All rights reserved.