Hello Andrew! Welcome here
Are you trying to add Google Analytics or Plausible? If it is a different Analytics provider, you can use a theme component to include the Analytics code in the head
part of your theme.
For info on theme components and how to create them, see here: Beginner's guide to using Discourse Themes as a primer.
If you are looking to add GA or Plausible, we have some topics on those already, see here: Setup Google Tag Manager for Analytics - howto / admins - Discourse Meta and Push custom events to Google Tag Manager and Analytics - howto / admins - Discourse Meta and Add Plausible Analytics tracking to Discourse.