I just started using Google Analytics and I have my code in my base html file for a Django web app.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script nonce="{{ CSP_NONCE }}" async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX"></script>
<script nonce="{{ CSP_NONCE }}">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag("config","G-XXXXXXXXX");
</script>
<!-- end GA -->
My question is, for the measurement id (G-XXXXXXXXX) is this something that needs to be a secret? I keep all my keys, etc in the env file and though I could do the same with this id but I keep running into errors. I tried {% 'GOOGLE_ID' %} but that didn't work.
Is there a good way to implement this?