Context. Radial gaps or cavities in the continuum emission in the IR-mm wavelength range are potential signatures of protoplanets embedded in their natal protoplanetary disk are . Hitherto, models have relied on the combination of mm continuum observations and near-infrared (NIR) scattered light images to put constraints on the properties of embedded planets. Atacama Large Millimeter/submillimeter Array (ALMA) observations are now probing spatially resolved rotational line emission of CO and other chemical species. These observations can provide complementary information on the mechanism carving the gaps in dust and additional constraints on the purported planet mass. Aims. We investigate whether the combination of ALMA continuum and CO line observations can constrain the presence and mass of planets embedded in protoplanetary disks. Methods. We post-processed azimuthally averaged 2D hydrodynamical simulations of planet-disk models, in which the dust densities and grain size distributions are computed with a dust evolution code that considers radial drift, fragmentation, and growth. The simulations explored various planet masses (1 M J ≤ M p ≤ 15 M J ) and turbulent parameters (10 −4 ≤ α ≤ 10 −3 ). The outputs were then post-processed with the thermochemical code DALI, accounting for the radially and vertically varying dust properties. We obtained the gas and dust temperature structures, chemical abundances, and synthetic emission maps of both thermal continuum and CO rotational lines. This is the first study combining hydrodynamical simulations, dust evolution, full radiative transfer, and chemistry to predict gas emission of disks hosting massive planets. Results. All radial intensity profiles of 12 CO, 13 CO, and C 18 O show a gap at the planet location. The ratio between the location of the gap as seen in CO and the peak in the mm continuum at the pressure maximum outside the orbit of the planet shows a clear dependence on planet mass and is independent of disk viscosity for the parameters explored in this paper. Because of the low dust density in the gaps, the dust and gas components can become thermally decoupled and the gas becomes colder than the dust. The gaps seen in CO are due to a combination of gas temperature dropping at the location of the planet and of the underlying surface density profile. Both effects need to be taken into account and disentangled when inferring gas surface densities from observed CO intensity profiles; otherwise, the gas surface density drop at the planet location can easily be overestimated. CO line ratios across the gap are able to quantify the gas temperature drop in the gaps in observed systems. Finally, a CO cavity not observed in any of the models, only CO gaps, indicating that one single massive planet is not able to explain the CO cavities observed in transition disks, at least without additional physical or chemical mechanisms.Key words. astrochemistry -planetary systems: protoplanetary disks -planetary systems: planet-disk interactions -submillimeter: planetary syste...