Simple SummaryQ fever infection in dairy herds is introduced through the transmission of the bacterium Coxiella burnetii, resulting in multiple detrimental effects such as reduction of lactation, abortions and chronic infection. Particularly in the UK, recent evidence suggests that the infection is endemic in dairy cattle. In this work, we investigate the dynamics of the disease with the aim to disentangle the relationship between the heterogeneity in the shedding routes and their effect on the environmental contamination. We develop a mathematical model for the transmission of Q fever within UK cattle herds by coupling the within-herd infection cycle of the disease with farm demographics and environmental effects, introduced by either the indoor or outdoor environment. The present analysis aims also to indicate the gaps in the available data required to optimise the proposed model or future models that will developed on the basis of the one proposed herein. Finally, the developed model can serve as mathematical proof for the assessment of various interventions for controlling the dynamics of Q fever infection.Q fever infection in dairy herds is introduced through the transmission of the bacterium Coxiella burnetii, resulting in multiple detrimental effects such as reduction of lactation, abortions and chronic infection. Particularly in the UK, recent evidence suggests that the infection is endemic in dairy cattle. In this work, we investigate the dynamics of the disease with the aim to disentangle the relationship between the heterogeneity in the shedding routes and their effect on the environmental contamination. We develop a mathematical model for the transmission of Q fever within UK cattle herds by coupling the within-herd infection cycle of the disease with farm demographics and environmental effects, introduced by either the indoor or outdoor environment. Special focus is given on the mechanism of transmission in nulliparous heifers and multiparous cattle. We calibrate the model based on available knowledge on various epidemiological aspects of the disease and on data regarding farm demographics available in the UK DEFRA. The resulting model is able to reproduce the reported prevalence levels by field and in silico studies, as well as their evolution in time. In addition, it is built in an manner that allows the investigation of different housing techniques, farm management styles and a variety of interventions. Sensitivity analysis further reveals the parameters having the major effect in maintaining high prevalence levels of seropositive and shedding cattle. The present analysis aims also to indicate the gaps in the available data required to optimise the proposed model or future models that will developed on the basis of the one proposed herein. Finally, the developed model can serve as mathematical proof for the assessment of various interventions for controlling the dynamics of Q fever infection.