With the growing number of gravitational wave (GW) detections and the advent of large galaxy redshift surveys, a new era in cosmology is emerging. This study explores the synergies between GWs and galaxy surveys to jointly constrain cosmological and GW population parameters. We introduce CHIMERA, a novel code for GW cosmology combining information from the population properties of compact binary mergers and galaxy catalogs. We study constraints for scenarios representative of the LIGO-Virgo-KAGRA O4 and O5 observing runs, assuming to have a complete catalog of potential host galaxies with either spectroscopic or photometric redshift measurements. We find that a percent-level measurement of H 0 could be achieved with the best 100 binary black holes (BBHs) in O5 using a spectroscopic galaxy catalog. In this case, the intrinsic correlation that exists between H 0 and the BBH population mass scales is broken. Instead, by using a photometric catalog the accuracy is degraded up to a factor of ∼9, leaving a significant correlation between H 0 and the mass scales that must be carefully modeled to avoid bias. Interestingly, we find that using spectroscopic redshift measurements in the O4 configuration yields a better constraint on H 0 compared to the O5 configuration with photometric measurements. In view of the wealth of GW data that will be available in the future, we argue the importance of obtaining spectroscopic galaxy catalogs to maximize the scientific return of GW cosmology.