Upcoming studies of extrasolar gas giants will give precise insights into the composition of planetary atmospheres with the ultimate goal to link it to the formation history of the planet. Previous models adopted either pebble- or planetesimal accretion for the growth of these planets. Here, we investigate how drifting and evaporating pebbles that enrich the gas phase of the disk influence the chemical composition of growing and migrating gas giants. To achieve this goal, we perform semi analytical 1D models of protoplanetary disks including viscous evolution, pebble drift and evaporation to simulate the growth of planets from planetary embryos toJupiter mass objects by the accretion of pebbles and gas while they migrate through the disk. The gas phase of the protoplanetary disk is enriched due to the evaporation of inward drifting pebbles crossing evaporationlines, leading to the accretion of large amounts of volatiles into the planetary atmosphere. As a consequence, gasaccreting planets are enriched in volatiles (C, O, N) compared to refractories (e.g. Mg, Si, Fe) by up to a factor of 100, depending on the chemical species and the disk’s viscosity. Our model also implies that Jupiter’s nitrogencontent does not require its formation close to the N2 evaporation front, as previous simulations indicated, due to the efficient accretion of nitrogen rich vapor. However, if the planetary atmosphere is polluted with solids(e.g. planetesimals), which are enriched in refractories, only slight differences in the volatile to refractory ratio are observed. Through the addition of solids in planetary atmospheres, the C/O ratio in the atmospheres is reduced slightly, but not significantly, due to oxygen bound in silicates within the solids. The C/O ratio alone can thus not be used to distinguish if solid accretion into planetary atmospheres is efficient. Instead, we conclude that the volatile to refractory ratio in planetary atmospheres can place a strong constraint on planet formationtheories, especially on the amount of accreted solids into atmospheres, making it an important target for futureobservations.