This article reports experimental measurements of germanium K-shell ionization cross sections and tin L-shell x-ray production cross sections by electron impact. In order to avoid the difficulty of preparing thin and uniform self-supporting targets, thin targets with thick substrates are used in the experiments. Since electrons reflected by the substrate can induce additional ionization of target atoms, we developed a method to correct the measured x-ray intensities and eliminated the influence of the substrate on measured data. Our measured cross sections are in good agreement with previous measurements. The present results are also compared with the predictions of theories and semiempirical and empirical formulas. It is found that the K-shell ionization cross sections of Ge at energies from near threshold to 40 keV can be reasonably described by the semiempirical formula of Green and Cosslett. Experimental absolute L-shell x-ray production cross sections of Sn are presented. It seems that, so far, none of the available theories can adequately interpret our L-shell results at low energies.