Firebase and attribution partners
OptSens passes each consent decision to Google Consent Mode in Firebase and to the attribution partners in your app. You do not write any forwarding code. The SDK finds each partner SDK at runtime. An app without a given SDK is not affected. Only the consent decision is passed on; the partner SDKs and their accounts are your own.
| SDK | Android | iOS / tvOS |
|---|---|---|
| Firebase Analytics | Automatic | Automatic |
| AppsFlyer | Automatic | Automatic |
| Adjust | Automatic | Automatic |
| Branch | Automatic | Automatic |
| Kochava | Automatic | Automatic |
Kochava applies the consent only when Intelligent Consent Manager is turned on in your Kochava dashboard. On iOS this needs Kochava SDK 8 or later.
When consent is sent
The SDK sends consent when it starts (the visitor's stored choice, or the defaults
of their region when there is none yet) and every time the consent changes: a
choice in the banner, a US privacy choice, and clearUserData.
The attribution partners receive consent whether Consent Mode is on or off. Firebase follows the Consent Mode type set in the dashboard, see Google Consent Mode v2.
Setup
- Android
- iOS / tvOS
Nothing to add. Add the partner SDKs you use as usual. For Firebase, add
com.google.firebase:firebase-analytics and the google-services plugin.
The SDK adds four Firebase entries to your app manifest. With them, Firebase starts with every consent type denied before the first event.
Add these four keys to your app's Info.plist. With them, Firebase starts with
every consent type denied before the first event:
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE</key><false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE</key><false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA</key><false/>
<key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS</key><false/>
Nothing else is needed for the partners.
If you use AppsFlyer, start it after configure has finished. Its first session
then carries the consent. AppsFlyer does not keep consent between sessions, and
the SDK sends it again at every start.
Google Mobile Ads (AdMob and Ad Manager)
Google Mobile Ads reads the IAB TCF keys that OptSens writes on the device. There is nothing to add to your app.
- With IAB TCF on, Google Mobile Ads receives the visitor's TC string and Google's additional consent string with every ad request.
- With IAB TCF off, there is no TC string to read, and Google Mobile Ads does not receive the visitor's choice.
If your app shows Google ads to users in the EEA, the UK or Switzerland, Google asks you to use a Google-certified CMP with IAB TCF. See Google's EU user consent policy. Turn IAB TCF on under Frameworks.
Another SDK
To pass consent to an SDK that is not in the table:
- Android
- iOS / tvOS
Read the visitor's choice with OptSens.hasConsent("advertising") (or another
category) at start and when the banner closes, and call your SDK's consent method.
Write a forwarder and add it to the built-in ones:
struct MySdkForwarder: ConsentForwarder {
func apply(_ signals: GcmSignals, gdprApplies: Bool, gcmEnabled: Bool) {
MySdk.setAdConsent(signals.adUserData == .granted)
}
}
OptSens.configure(apiKey: "YOUR_SDK_ID", options: OptSensOptions(
consentForwarder: CompositeConsentForwarder([
CompositeConsentForwarder.automatic,
MySdkForwarder(),
])))
On iOS, Firebase Analytics must be loaded in your app, not only linked. An app that calls Analytics anywhere meets this.
After a reject, Google Consent Mode still sends cookieless pings by design
(analytics_storage = denied means no identifiers, not silence). To send nothing
to Google before consent, choose the basic Consent Mode type.