Let $G$ be a Lie group with Lie algebra $\mathfrak{g}$ and let $\pi:P\to\mathcal{M}$ be a principal $G$-bundle over a smooth orientable manifold $\mathcal{M}$. Furthermore, let $\langle\cdot,\cdot\rangle_{\mathfrak{g}}$ be an $\mathrm{Ad}$-invariant non-degenerate symmetric bilinear form on $\mathfrak{g}$. Furthermore, we assume that $G$ is compact and simply-connected and that $\mathcal{M}$ has dimension $\leq 3$, because if this is the case, then the bundle $P$ is trivial.
Chern-Simons theory is defined by the action \begin{align}\mathcal{S}_{\mathrm{CS}}[s,A]:=\frac{k}{4\pi}\int_{\mathcal{M}}\,\bigg\{s^{\ast}\operatorname{tr}(A\wedge\mathrm{d}A)+\frac{1}{3}s^{\ast}\mathrm{tr}(A\wedge [A\wedge A])\bigg\},\end{align}
for all global sections $s\in\Gamma^{\infty}(P)$ and $1$-forms $A\mathcal{C}(A)\subset\Omega^{1}(P,\mathfrak{g})$$A\in\mathcal{C}(A)\subset\Omega^{1}(P,\mathfrak{g})$. The product $\mathrm{tr}(\cdot\wedge\cdot)$ denotes the wedge-product induced by the form $\langle\cdot,\cdot\rangle_{\mathfrak{g}}$. The quantity $k$ is a constant, called the label"level" of the theory.
Now, the action is in general dependent of the choice of gauge. In general, one can easily proof that
$$\mathcal{S}_{\mathrm{CS}}[f\circ s,A]-\mathcal{S}_{\mathrm{CS}}[s,A]=\mathcal{S}_{\mathrm{CS}}[s,f^{\ast}A]-\mathcal{S}_{\mathrm{CS}}[s,A]=-\frac{k}{24\pi}\int_{\mathcal{M}}\,s^{\ast}\mathrm{tr}(\theta\wedge [\theta\wedge\theta])$$
for all principal bundle automorphisms $f:P\to P$ with $\theta:=\sigma_{f}^{\ast}\mu_{G}$, where $\mu_{G}\in\Omega^{1}(G,\mathfrak{g})$ denotes the Maurer-Cartan form on $G$ and where $\sigma_{f}\in C^{\infty}(P,G)^{G}$ is the map defined by $f(p)=p\cdot\sigma_{f}(p)$ for all $p\in P$.
In order to get a well-defined gauge-invariant Chern-Simons action, one hence usually assumes that $\langle\cdot,\cdot\rangle_{\mathfrak{g}}$ fulfills the "integrality condition" that the closed $3$-form
$$-\frac{k}{24\pi}\mathrm{tr}(\mu_{G}\wedge [\mu_{G}\wedge\mu_{G}])$$
represents an integral class in $H^{3}(G;\mathbb{R})$, because if this is the case, we get a well-defined action $\mathcal{S}_{\mathrm{CS}}:\mathcal{C}(P)\to\mathbb{C}/\mathbb{Z}$. This is for example stated in "Hypothesis 2.5" in
- D. S. Freed: Classical Chern-Simons Theory, Part 1. Advances in Mathematics, 113(2):237–303, 1995. Preprint: arXiv:hep-th/9206021.
Is there any known criterion when this is the case? I mean, if $G$ is simple and compact, then $\langle\cdot,\cdot\rangle_{\mathfrak{g}}$ is necessarily a negative multiple of the Killing form, so there is not much freedom in choosing this bilinear form...