I have no strong recommendations about the analytics, it's a problem I've butted up against once in a while but I am not well versed in the options for rich logging, and without some detailed knowledge of your game's architecture I would probably just lead you astray. I tend to just review the relevant packages in NPM and see which one most closely aligns with my style and intent.
In the work I've done before I liked a paradigm called event-sourced architecture. I am not sure that it is relevant to your game, but the basic idea is that all user interactions and sources of random data are logged to a single table in a database with a timestamp, so you can rewind and replay events to reconstruct application state for testing / debugging. Although it is done for performance reasons too.
It's a bit of a watch and it is more targeted to large web applications, but if you are interested:
https://www.youtube.com/watch?v=8JKjvY4etTY&t=1s
I would suggest you try out "feature flags". For example, if I was working with the codebase right now, I might put the ability for wandering parties to attack garrisons behind a feature flag until garrison defense was implemented, maybe as a cookie or session storage item. I would also have a special development flag for 'turn everything on'. Then when the feature is complete, just delete the if-check that determines whether or not the feature should be available, and keep it on all the time. This would allow you to not have to manage testing and release branches and make it relatively easy for you to enter the test mode on most setups.
Although that particular example might be moot considering your upcoming release, in general it's a good way to keep features merged in to your main codebase and up to date, while keeping the rest of your app (game) well-oiled.
I am starting to feel like I am clogging up your page with comments, is there a way we can DM?
Edit: I just now realized I discombobulated some paragraphs here. The event sourcing stuff was in relation to analytics.