We report comprehensive x-ray absorption spectroscopy studies at both Ga K-edge and Yb L2edge to elucidate the local structure of Ga and Yb dopants in YbxGayCo4Sb12. Our extended x-ray absorption fine structure (EXAFS) data confirm that Ga atoms occupy two crystallographic sites: one is the 24g site replacing Sb, and the other is the 2a site in the off-center void position. We find that the occupancy ratio of these two sites varies significantly as a function of the filling fraction of additional Yb, which exclusively occupies the 2a on-center site. At low concentrations of Yb, Ga24g and Ga2a dopants coexist and they form a charge-compensated compound defect proposed by Qiu et al. [Adv. Funct. Mater. 23, 3194 (2013)]. The Ga24g occupancy increases gradually with increasing Yb concentration, and almost all Ga occupies the 24g site for the highest Yb concentration studied(x = 0.4). In addition to the local structural evidence provided by our EXAFS data, we also present x-ray absorption near-edge structure (XANES) spectra, which show a small Ga K-edge energy shift as a function of Yb concentration consistent with the change from predominantly Ga2a to Ga24g states. Our result suggests that the increased solubility of Yb in Yb-Ga co-doped Co4Sb12 skutterudites is due to the increased Ga24g electron acceptor, and thus provides an important strategy to optimize the carrier concentration in partially filled skutterudites.