  We perform a unified description of the experimental data of the $\pi^+\pi^-$
and $J/\psi\pi^\pm$ invariant mass spectra for $e^+e^- \rightarrow J/\psi
\pi^+\pi^-$ and the $D^0 D^{\ast-}$ mass spectrum for $e^+e^- \rightarrow D^0
D^{\ast-} \pi^+$ at $e^+e^-$ center-of-mass energies 4.23 and 4.26 GeV. The
analysis takes into account open-charm meson loops that contain triangle
singularities, the $J/\psi\pi$-$D\bar D^*$ coupled-channel interaction
respecting unitarity, and the strong $\pi\pi$-$K\bar K$ final state interaction
using dispersion relations. The analysis leads to a precise determination of
the $Z_c(3900)$ pole with the pole mass and width $(3880.7 \pm
1.7_\text{stat}\pm 22.4_\text{syst})$ MeV and $(35.9 \pm 1.4_\text{stat}\pm
15.3_\text{syst})$ MeV, respectively, and hints at that the $D\bar D^*$
molecular and non-molecular components are of similar importance in the
$Z_c(3900)$ formation.
