The purpose of this study was to provide a procedure for the inclusion of milk spectral information into genomic prediction models. Spectral data were considered a set of covariates, in addition to genomic covariates. Milk yield and somatic cell score were used as traits to investigate. A cross-validation was employed, making a distinction for predicting new individuals’ performance under known environments, known individuals’ performance under new environments, and new individuals’ performance under new environments. We found an advantage of including spectral data as environmental covariates when the genomic predictions had to be extrapolated to new environments. This was valid for both observed and, even more, unobserved families (genotypes). Overall, prediction accuracy was larger for milk yield than somatic cell score. Fourier-transformed infrared spectral data can be used as a source of information for the calculation of the ‘environmental coordinates’ of a given farm in a given time, extrapolating predictions to new environments. This procedure could serve as an example of integration of genomic and phenomic data. This could help using spectral data for traits that present poor predictability at the phenotypic level, such as disease incidence and behavior traits. The strength of the model is the ability to couple genomic with high-throughput phenomic information.