Naively, I think the simplest way to include gravity in the Standard Model is to treat the metric $g$ as a variable in the Lagrangian $\mathcal{L}_{SM} $ defined on a (compact) time-orientable Lorentzian manifold $(M,g)$ (reference: Mathematical Gauge Theory With Applications to the Standard Model of Particle Physics by Mark J.D. Hamilton).
\begin{aligned} \mathscr{L}_{SM} & =\mathscr{L}_D[\Psi, A]+\mathscr{L}_H[\Phi, A]+\mathscr{L}_Y\left[\Psi_L, \Phi, \Psi_R\right]+\mathscr{L}_{YM}[A] \\ & =\operatorname{Re}\left(\bar{\Psi} D_A \Psi\right)+\left\langle d_A \Phi, d_A \Phi\right\rangle_E-V(\Phi)-2 g_Y \operatorname{Re}\left(\bar{\Psi}_L \Phi \Psi_R\right)-\frac{1}{2}\left\langle F_M^A, F_M^A\right\rangle_{Ad(P)}\end{aligned}
(Here $D_A$ is Dirac operator with respect to metric $g$ and connection $1$-form $A$ of a principal $U(1)\times SU(2)\times SU(3)$-bundle $P$, $d_A$ is an exterior covariant derivative with respect to $A$, $E$ is a vector bundle whose structure group is $U(1)\times SU(2)\times SU(3)$, $\left\langle\,, \right\rangle_E$ is product of "$U(1)\times SU(2)\times SU(3)$-invariant bundle metric of $E$" and "inner product of $1$-form of $M$, $Ad(P)$ is the adjoint vector bundle, $F_M^A\in\Omega$ is $Ad(P)$-valued $2$-form induced from curvature $2$-form $F_A$ with respect to connection $1$-form $A$ and, $\left\langle \,,\,\right\rangle_{Ad(P)}$ is product of "inner product of $Ad(P)$" and "inner product of $2$-form of $M$".)
Please note that $D_A$ includes $g$ as spin connection (spin connection can be written by using Levi-Civita connection) and innner product of forms are calculated by using metric $g$ and then include metric (more precisely, induced metric $g^*$ on the cotangent vector bundle $T^*M$).
Also $\sqrt{g}$ appears in the action integral as volume form.
I’ve seen a Lagrangian that contains the Ricci scalar. However the $\mathcal{L}_{SM}$ already contains terms which include $g$ and it doesn't seem we should add Ricci scalar to the Lagrangian since metric is coupled to all fields in $\mathcal{L}_{SM}$ (universal gravitation).
Is there a problem with simply treating the metric in the Standard Model Lagrangian as a dynamical variable? I think gravity can be quantized by path integral (of cause we need to be careful not to add equivalent metrics and probably integrate with respect to equivalent class of manifold $M$).
Edit
I would like to ask: If we treat the metric in the Standard Model Lagrangian on a Lorentz manifold as a variable (without adding the Ricci scalar), does the theory become non-renormalizable?
I naively think we don't need to add Ricci scalar term to Lagrangian because I think the Einstein field equations are statistical-mechanical equations that emerge when dealing with a large number of particles, and that they can be derived from the theory of QFT of the $\mathcal{L}_{SM}$.