Q fever is an infective, contagious and zoonotic disease caused by Coxiella burnetii, an obligate intracellular bacterium. The first goal of this research was to assess the efficacy of a diagnostic strategy based on real-time PCR (r-t PCR) assays on bulk tank milk (BTM) for the detection of infected dairy herds/flocks, with the aim of estimating the prevalence of Q fever infection in dairy herds and in goats flocks. The second goal was to evaluate the dynamics of the antibodies response and the C. burnetii excretion in infected animals. The sensitivity and specificity of a single r-t PCR test on BTM were evaluated using a control-case study in dairy herds and goat flocks. To study the C. burnetii transmission in dairy herds and goats flocks a longitudinal study was performed. The sensitivity and specificity of BTM r-t PCR in dairy herds were respectively equal to 0.5 and 1, and in dairy flocks 0.8 and 1. The results highlighted in dairy cows a great gap between the seroprevalence and the percentage of shedders found in the herds. The seroprevalence was on average 30,6%, while the percentage of shedders was at least 13% and the percentage of strong shedders was only 1,7%. We observed also the presence of 14 cows shedding C. burnetii in milk without an appreciable serological response. Shedding in feces was sporadic and only 9 cows were found to shed the bacterium occasionally through this route. The goats sampled were 257, coming from 3 flocks very different in size, ranging from 12 to 171 goats. The shedders of C. burnetii in milk were 59 (23%), the ELISA seropositive goats 177 (69%), the CFT seropositive goats 11 (4%). The percentage of shedders in milk was very different among the flocks, ranging from 100% of farm 2 to 1% of farm 3. Shedding of C. burnetii in stools was detected only occasionally in flocks 2 and 3, while in flock 1 at 2nd sampling 15 positives goats were detected. The great majority of ELISA seropositive goats kept this status throughout the study time