Recent observations of extrasolar gas giants suggest super-stellar C/O ratios in planetary atmospheres, while interior models of observed extrasolar giant planets additionally suggest high heavy element contents. Furthermore, recent observations of protoplanetary disks revealed super-solar C/H ratios, which are explained by inward drifting and evaporating pebbles, enhancing the volatile content of the disk. We investigate in this work how the inward drift and evaporation of volatile rich pebbles influences the atmospheric C/O ratio and heavy element content of giant planets growing by pebble and gas accretion. To achieve this goal, we perform semi analytical 1D models of protoplanetary disks including the treatment of viscous evolution and heating, pebble drift and simple chemistry to simulate the growth of planets from planetary embryos to Jupiter mass objects by accretion of pebbles and gas while they migrate through the disk. Our simulations show that the composition of the planetary gas atmosphere is dominated by the accretion of vapor, originating from inward drifting evaporating pebbles. This process allows the giant planets to harbour large heavy element contents, in contrast to models that do not take pebble evaporation into account. In addition, our model reveals that giant planets originating further away from the central star have a higher C/O ratio on average due to the evaporation of methane rich pebbles in the outer disk. However, planets formed in the outer disk harbor a smaller heavy element content, due to a smaller vapor enrichment of the outer disk compared to the inner disk. Our model predicts that giant planets with low/large atmospheric C/O should harbour a large/low total heavy element content. We further conclude that the inclusion of pebble evaporation is a key ingredient to determine the heavy element content and composition of giant planets.