I know the best practice is to setup Google Tag Manager and Cookiebot in head scripts, but I really do not want to manage hardcoded scripts across multiple pages. We do not load scripts on any pages, so I think an okay approach even if it is not best practice is to handle the Cookiebot setup script and the GTM initialisation as custom functions triggered sequentially by callbacks so they are set in order on the page load event.
This is then placed in a global tracking component on every page root. But I do experience some problems on receiving analytics from page visits.
I would like to hear if anyone has successfully found an implementation that works which is centralized?