Let's say we have a complex scalar field in a curved background whose action is: \begin{equation} S=-\int d^4x \sqrt{-g}\phi^\ast(\square_g+m^2) \phi \end{equation} For some purpose I want to calculate its partition function $Z$: \begin{equation} Z=\int \mathcal{D}\phi^\ast \mathcal{D}\phi\,e^{iS[\phi^\ast,\phi]} \end{equation} I know that in Minkowski space-time this partition function is just $\propto [\det(\square+m^2)]^{-1}$. But how should I do with the square root of the determinant of the metric? I am not sure of what I do next:
To evaluate this integral I split it into an infinite number of integrals: \begin{align} Z &\propto \prod_{i}\int d\phi^\ast_id\phi_i\,e^{-ia^4\sqrt{-g_i}\phi^\ast_i [(\square_g+m^2)\phi]_i} \\ &\propto\prod_i \frac{1}{\sqrt{-g_i} \lambda_i} =: \frac{1}{\det(\square_g+m^2)}\prod_i \frac{1}{\sqrt{-g_i}} \end{align} Is this a good way of doing this?