flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

🐛 [firebase_analytics] Implement consent mode v2

Open szepeshazi opened this issue 1 year ago • 8 comments

As per https://developers.google.com/tag-platform/security/guides/app-consent?platform=ios the recommended way to set user consent is consent mode v2, which enables toggling the following four individual properties.

AD_PERSONALIZATION | Sets consent for personalized advertising.
AD_STORAGE | Enables storage (such as device identifiers) related to advertising.
AD_USER_DATA | Sets consent for sending user data to Google for advertising purposes.
ANALYTICS_STORAGE | Enables storage (such as app identifiers) related to analytics, e.g. visit duration.

In the firebase_analytics plugin, the setConsent method signature is

/// Sets the applicable end user consent state. 'default' value for 'adStorageConsentGranted' & 'analyticsStorageConsentGranted' is 'true'
  Future<void> setConsent({
    bool? adStorageConsentGranted,
    bool? analyticsStorageConsentGranted,
  }) 

exposing only two of the four above mentioned properties.

Please update firebase_analytics in flutterfire to support Google consent mode v2.

szepeshazi avatar Jan 11 '24 16:01 szepeshazi

There are major marketing implications for tons of of apps out there if we cannot implement the consent mode v2. I hope you guys can make it a priority. Thanks for your work!

olenirwing avatar Jan 18 '24 10:01 olenirwing

To raise attention, I'd also like to leave a comment here. For us it's also crucial to use V2 soon. Maybe you can roughly estimate when this will be implemented, so that we know that we might need to use workarounds before we go live.

leo-mms avatar Jan 29 '24 12:01 leo-mms

I'm facing the same problem, please make this a priority to implement the consent mode v2.

shanelic avatar Feb 02 '24 07:02 shanelic

I can also only emphasize, that it is crucial for us that we have support for setting these additional consent flags prior to the rollout of Google Consent Mode V2 in March 2024.

kaptnkoala avatar Feb 06 '24 11:02 kaptnkoala

As an update, we are planning on updating the API for the above mentioned, we're just going through an API review before implementing. I will let you know when it is released 🙏

russellwheatley avatar Feb 07 '24 13:02 russellwheatley

@russellwheatley I began implementing this yesterday and have already submitted a pull request today. Would you prefer that I proceed with further enhancements, or do you currently have an open pull request in progress internally?

matinzd avatar Feb 07 '24 13:02 matinzd

@matinzd - I have the bones of a PR which is on hold until we decide on API. Happy to proceed with your PR once decided if you care to update when the time to implement arrives 😄

russellwheatley avatar Feb 07 '24 13:02 russellwheatley

@russellwheatley I am available as soon as you have the internal discussions resolved. Just ping me in the PR.

matinzd avatar Feb 07 '24 14:02 matinzd

this setConsent is not valid for FLutter web, how can I set consent in flutter web?

JgomesAT avatar Feb 20 '24 14:02 JgomesAT

@JgomesAT - It will be allowed in upcoming PR. See docs

russellwheatley avatar Feb 20 '24 16:02 russellwheatley

Great news

JgomesAT avatar Feb 20 '24 16:02 JgomesAT

any schedule, for when that will be ready

JgomesAT avatar Feb 21 '24 07:02 JgomesAT

@russellwheatley Would you please let me know when you are planning for upcoming PR? Because our product highly depends on Analytics in EU region. Thanks for your support and contribute to this.

nitinrgadhiya avatar Feb 27 '24 13:02 nitinrgadhiya

@russellwheatley what is the final status about this? There is a deadline to implement Consent Mode V2 for 6. March, and there is no official solution for Flutter Apps.

ibrahimdevs avatar Mar 04 '24 10:03 ibrahimdevs

@ibrahimdevs I've done customisation in the local and the package works fine for me.

Firebase analytics : 10.8.6

I've played around above mention version so please be careful If you have another version in your project.

Integrate into your project using this fork URL https://github.com/firebase/flutterfire/compare/master...nitinrgadhiya:flutterfire:consent_v2

Please review the changes from the GitHub fork, understand their purpose, and integrate them into the original project. If you have any questions, reach out to me.

nitinrgadhiya avatar Mar 04 '24 21:03 nitinrgadhiya

Hey everyone, sorry for the delay. We have the green light for this API update.

@matinzd - let me know if you wish to proceed with your PR. I've provided some feedback 😄

russellwheatley avatar Mar 12 '24 17:03 russellwheatley

@russellwheatley thanks for addressing this! Great help. Could you give us some hints on the release ETA?

szepeshazi avatar Mar 25 '24 13:03 szepeshazi

@szepeshazi - Hopefully today, definitely tomorrow 👍

russellwheatley avatar Mar 25 '24 14:03 russellwheatley