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.
I have the same issue. Under Themes it shows “No Items” so I cannot add any components to a theme because I dont seem to have one. I read the Beginners guide to using Discourse Themes, however there seem to be themes installed already. I dont have any.