  We combine x-ray absorption spectroscopy (XAS), x-ray magnetic circular
dichroism (XMCD) and x-ray magnetic linear dichroism (XMLD) data with first
principles density functional theory (DFT) calculations and a multiorbital many
body Hamiltonian approach to understand the electronic and magnetic properties
of Co atoms adsorbed on h-BN/Ru(0001) and h-BN/Ir(111). The XAS line shape
reveals, for both substrates, an electronic configuration close to $3d^8$,
corresponding to a spin $S = 1$. Magnetic field dependent XMCD data show large
(14 meV) out-of-plane anisotropy on h-BN/Ru(0001), while it is almost isotropic
(tens of $\mu$eV) on h-BN/Ir(111). XMLD data together with both DFT
calculations and the results of the multiorbital Hubbard model suggest that the
dissimilar magnetic anisotropy originates from different Co adsorption sites,
namely atop N on h-BN/Ru(0001) and 6-fold hollow on h-BN/Ir(111).
