Context. Strong lensing mass measurements require the knowledge of the redshift of both the lens and the source galaxy. Traditionally, spectroscopic redshifts are used for this purpose. Upcoming surveys, however, will lead to the discovery of ∼105 strong lenses, and it will be very difficult to obtain spectroscopic redshifts for most of them. Photometric redshift measurements will also be very challenging due to the blending between lens and source light. Aims: The goal of this work is to demonstrate how to carry out an inference of the structural properties of the galaxy population from the analysis of a set of strong lenses with no individual source redshift measurements, and to assess the loss in precision compared to the case in which spectroscopic redshifts are available. Methods: Building on the formalism introduced in Paper III, I developed a method that allows a statistical strong lensing inference to be carried out while marginalising over the source redshifts. This method, which relies on the knowledge of the properties of the unlensed background source population and of the selection function of the survey, generalises an approach known as photogeometric redshift, originally introduced by the Strong Lensing Legacy Survey collaboration. I tested the method on simulated data consisting of a subset of 137 strong lenses that is complete above a cut in observational space. Results: The method recovers the properties of the galaxy population with a precision that is comparable to that attainable in the case in which individual source redshifts are known. Conclusions: The photogeometric redshift method is a viable approach for the analysis of large sets of strong lenses provided that the background source population properties and lens selection function are well known.