Suppose I have a log Gaussian Cox process (LGCP) $X$ with log intensity function $\lambda(x)=S(x)$ where $S$ follows a Gaussian process. Since LGCP still falls under the umbrella of inhomogeneous Poisson processes, the likelihood of an observed point process $(x_1,...,x_n)$ should be proportional to the following density
$$ p(X|S) \propto \prod_{i=1}^n \exp[S(x_i)] \exp[-\exp[S(x_i)]] $$
However I've seen an alternative formulation which replaces the double exponent term dependent on $i$ with a constant equal to the average number of events in the study region.
$$ p(X|S) \propto \prod_{i=1}^n \exp[S(x_i)] \exp\left( -\int_\mathcal{D} \exp[S(x)]dx \right) $$
Which one is correct?