Measuring the open loop transfer function in closed loop: what's the better approach?
You have two signals to use, the reference and the measurements. You generate the error from these two signals. There is no additional information in that signal.

Closed-loop identification is more difficult than open-loop because the feedback makes the input and the noise correlated. Consider the standard feedback system


where $\bar{C} = C H$, $G_{0} = G$, $r_{2} = 0$, $r_{1} = C r$ to make it equivalent to your block diagram. A direct identification of a model $G_{m}$ means minimizing
$$
V(\theta) = \frac{1}{2\pi} \int_{-\pi}^{\pi} \left| G_{0}(\text{e}^{j\omega}) - B(\text{e}^{j\omega}) - G_{m}(\text{e}^{j\omega},\theta) \right|^{2} \frac{\Phi_{u}(\omega)}{\left|H^{*}(\text{e}^{j\omega})\right|^{2}}
$$
where the bias term is given by
$$
B = \frac{\bar{C} S_{0} H_{0} \Delta H {\sigma_{\bar{e}}}^{2}}{\Phi_{u}}
$$
and $\Delta H = H_{0} - H^{*}$, where $H^{*}$ is an assumed, fixed noise model, and $S_{0}$ is the input sensitivity function of the diagram. The bias in the model estimate $G_{m}$ will be small if


The noise model $H^{*}$ is accurate.
The signal-to-noise ratio at the input $u$ is large.


The estimation can be improved by using more elaborate identification methods. A great survey is found in Chapter 9 here.

The choice of excitation signal in order to minimize your estimation variance is discussed in Chapter 7 in the above reference, and another great paper can be found here.