Discourse doesn’t “have” CMS, in a sense it can be said to be a CMS, but it is that and a lot more, it just depends on how you set it up and how you use.
That said, to set up GA tracking, see:
- Setup Google Tag Manager for Analytics - howto / admins - Discourse Meta
- Using nonces in Google Tag Manager scripts
Go through them both to get the full picture.