Individual variation in infection modulates both the dynamics of pathogens and their impact on host populations. It is therefore crucial to identify differential patterns of infection and understand the mechanisms responsible. Yet our understanding of infection heterogeneity in wildlife is limited, even for important zoonotic host–pathogen systems, owing to the intractability of host status prior to infection. Using novel applications of stable isotope ecology and eco-immunology, we distinguish antecedent behavioural and physiological traits associated with avian influenza virus (AIV) infection in free-living Bewick's swans (Cygnus columbianus bewickii). Swans infected with AIV exhibited higher serum δ13C (−25.3 ± 0.4) than their non-infected counterparts (−26.3 ± 0.2). Thus, individuals preferentially foraging in aquatic rather than terrestrial habitats experienced a higher risk of infection, suggesting that the abiotic requirements of AIV give rise to heterogeneity in pathogen exposure. Juveniles were more likely to be infected (30.8% compared with 11.3% for adults), shed approximately 15-fold higher quantity of virus and exhibited a lower specific immune response than adults. Together, these results demonstrate the potential for heterogeneity in infection to have a profound influence on the dynamics of pathogens, with concomitant impacts on host habitat selection and fitness.