Inferring causal effects between variables when utilizing observational data is challenging due to confounding factors not controlled through a randomized experiment. Propensity score matching can decrease confounding in observational studies and offers insights about potential causal effects of prophylactic management interventions such as vaccinations. The objective of this study was to determine potential causality and impact of vaccination with an Escherichia coli J5 bacterin on the productive performance of dairy cows applying propensity score matching techniques to farm-recorded (e.g., observational) data. Traits of interest included 305-d milk yield (MY305), 305-d fat yield (FY305), 305-d protein yield (PY305), and somatic cell score (SCS). Records from 6,418 lactations generated by 5,121 animals were available for the analysis. Vaccination status of each animal was obtained from producer-recorded information. Confounding variables considered were herd-year-season groups (56 levels), parity (5 levels: 1, 2, 3, 4, and ≥5), and genetic quartile groups (4 levels: top 25% through bottom 25%) derived from genetic predictions for MY305, FY305, PY305, and SCS, as well as for the genetic susceptibility to mastitis. A logistic regression model was applied to estimate the propensity score (PS) for each cow. Subsequently, PS values were used to form pairs of animals (1 vaccinated with 1 unvaccinated control), depending on their PS similarities (difference in PS values of cows within a match required to be <20% of 1 standard deviation of the logit of PS). After the matching process, 2,091 pairs of animals (4,182 records) remained available to infer the causal effects of vaccinating dairy cows with the E. coli J5 bacterin. Causal effects estimation was performed using 2 approaches: simple matching and a bias-corrected matching. According to the PS methodology, causal effects of vaccinating dairy cows with a J5 bacterin on their productive performance were identified for MY305. The simple matched estimator suggested that vaccinated cows produced 163.89 kg more milk over an entire lactation when compared with nonvaccinated counterparts, whereas the bias-corrected estimator suggested that such increment in milk production was of 150.48 kg. Conversely, no causal effects of immunizing dairy cows with a J5 bacterin were identified for FY305, PY305, or SCS. In conclusion, the utilization of PS matching techniques applied to farm-recorded data was feasible and allowed us to identify that vaccination with an E. coli J5 bacterin relates to an overall milk production increment without compromising milk quality.