I'm currently working on a consent management system for my platform where we use firebase for analytics and AdSense for Ads. However the api is badly documented on this subject and there doesn't seem to be simple, straightforward ways to configure consent options like when using gtag consent commands directly, which don't seem to be supported on the firebase api.
After some days of research I've come up with initialising analytics with these gtag configs/properties: allow_google_signals: false, allow_ad_personalization_signals: false,
to disable ad data collection and personalization. After that I set analytics collection to false, which is straightforward enough. However this isn't ideal as I'm initialising analytics and it might not get used. Is there a better way to do this?
The effect I'm aiming for is the same as calling gtag('consent', 'default', { 'ad_storage': 'denied', 'analytics_storage': 'denied' });
which doesn't seem to be possible to do as firebase uses gtag internally and exposes no access to it besides to it's config command.