Control block diagram with sampling output
Let \$\small G_3(s)=\left[ G_1(s)\rightarrow sampler \rightarrow G_2(s)\right]\$, and \$\small C(s)=\$ output signal of \$\small G_2(s)\$; then the loop equation is:
$$\small C(s)= \frac{R(s)\:G_3(s)}{1+H(s)\:G_3(s)}$$

Taking z-transforms:

\$\small R(s)G_3(s)\rightarrow RG_3(z)\rightarrow RG_1(z)\:G_2(z)\$ (noting that \$\small RG_1\$ and \$\small G_2\$ may be separated due to the intervening sampler);

\$\small H(s)G_3(s)\rightarrow HG_1G_2(z)\$ (noting that \$\small HG_1\$ and \$\small G_2\$ cannot be separated since \$\small HG_1\$ is not a signal)

Hence: $$\small C(z)= \frac{RG_1(z)\:G_2(z)}{1+HG_1G_2(z)}$$