GA4 Consent Mode & Firebase Analytics / setAnalyticsCollectionEnabled

275 views
Skip to first unread message

Eric Ho

unread,
Jul 27, 2023, 9:31:22 PM7/27/23
to Firebase Google Group
Hi,

Is there anyone have experienced setting up Consent Mode along side with Firebase Analytics (GA4) in an app project?

Base on this information from the following websites 

I can adapt consent mode by enable this with the following code and the analyticsSignal / adSignal are came from Consent Management Platform. 

Analytics.setConsent([.analyticsStorage: analyticsSignal ? .granted : .denied , .adStorage: adSignal ? .granted : .denied])


With the above setup, do I need to enable the analytics collection all the time (e.g by setting this isAnalyticsTrackingEnableFlag =  true)

e.g . Analytics.setAnalyticsCollectionEnabled(isAnalyticsTrackingEnableFlag)

or I can still need to enable the analytics collection based on some sort of consent flag? 
let isAnalyticsTrackingEnable:Bool = someConsentFlag 
Analytics.setAnalyticsCollectionEnabled(isAnalyticsTrackingEnable)

But what if the someConsentFlag is set to false and no analytics data will be fired based on the current implementation, will the Consent Mode setup have any effect (e.g. is the Google Analytics SDK for Firebase stills able to send out ping signal to GA4?)

Eric


Disclaimer:

The contents of this email and any attachments are confidential to the intended recipient.  If you are not the intended recipient, you are hereby notified that any use, retention, disclosure, copying, printing, forwarding or dissemination of the message is strictly prohibited. If you have received the message in error, please erase all copies of the message (including attachments) from your system and notify the sender immediately.  Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited. Thank you!

Reply all
Reply to author
Forward
0 new messages