  The Mg II h and k lines are among the strongest in the near-ultraviolet solar
spectrum and their line core originates in the upper chromosphere, just below
the transition region. Consequently, they have become one of the main targets
for investigating the magnetism of the upper solar atmosphere. The recent
CLASP2 mission obtained unprecedented spectropolarimetric data of these lines
in an active region plage, which have already been used to infer the
longitudinal component of the magnetic field by applying the weak field
approximation. In this paper, we aim at improving our understanding of the
diagnostic capabilities of these lines by studying the emergent Stokes profiles
resulting from radiative transfer calculations in a radiative
magneto-hydrodynamic (rMHD) time-dependent model representative of a solar
plage. To this end, we create a synthetic observation with temporal and spatial
resolutions similar to those of CLASP2. We find strong asymmetries in the
circular polarization synthetic profiles which considerably complicate the
application of the weak field approximation. We demonstrate that the selective
application of the weak field approximation to fit different spectral regions
in the profile allows to retrieve information about the longitudinal component
of the magnetic field at different regions of the model atmosphere, even when
the circular polarization profiles are not anti-symmetric and are formed in the
presence of strong velocity and magnetic field gradients.
