Wie richte ich Anzeigenvermittlungsquellen ein, um DSGVO- und US-Einstellungen zu verwenden, die aus dem UMP SDK von GooAndroid

Forum für diejenigen, die für Android programmieren
Guest
 Wie richte ich Anzeigenvermittlungsquellen ein, um DSGVO- und US-Einstellungen zu verwenden, die aus dem UMP SDK von Goo

Post by Guest »

Hintergrund
Ich verwende Admob seit vielen Jahren zum Schalten von Anzeigen in meinen Apps. Irgendwann musste ich den neuen DSGVO-Einwilligungsdialog hinzufügen, damit er gemäß den neuen EU-Regeln verwendet werden konnte und das Admob SDK seine Ergebnisse automatisch verwendet.
https://developers. google.com/admob/android/privacy
Das hat gut funktioniert, da ich das SDK von Google verwendet habe und Google bereits Admob besitzt, um dieses SDK zu verwenden.
Das Problem
Kürzlich habe ich Vermittlungsunterstützung hinzugefügt, um verschiedene Anzeigenquellen einzubeziehen, um einen gewissen Wettbewerb zwischen ihnen zu schaffen:
https://developers.google.com/admob /android/choose-networks
Im Gegensatz zu Admob ziehen leider nur sehr wenige Anzeigenquellen automatisch den Wert aus dem, was der Benutzer ausgewählt hat. Tatsächlich habe ich nur sehr wenige gefunden, die das tun: AppLovin und wahrscheinlich auch Mintegral (benötigt zusätzlichen Code vor der Initialisierung, aber das war's).
Für die meisten Anzeigenquellen ist es das besagt, dass die Daten darüber, ob der Benutzer akzeptiert hat oder nicht, im Code an das SDK übergeben werden sollen.
Darüber hinaus gibt es zusätzlich zu den DSGVO-Regeln neue Regeln für die USA selbst:
https://developers.google.com/admob/and ... ab-support
Die Sache ist, ich kann den Wert, den ich habe, nicht finden müssen für sie festgelegt werden, nicht der DSGVO für die verschiedenen Werbenetzwerke und auch nicht der neuen US-Regel.
Sogar Applovin (und wahrscheinlich auch Mintegral) überprüft die USA nicht Teil des SDK.
Was ich gefunden habe
In der Vergangenheit habe ich Folgendes verwendet, damit Analytics die Situation sehen kann: Zum Beispiel: Ich habe Folgendes erstellt:

Code: Select all

@WorkerThread
fun canShowPersonalizedAds(context: Context): Boolean {
val prefs = PreferenceUtil.getDefaultSharedPreferences(context)
//https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#in-app-details
//https://support.google.com/admob/answer/9760862?hl=en&ref_topic=9756841
val purposeConsent = prefs.getString("IABTCF_PurposeConsents", "") ?: ""
val vendorConsent = prefs.getString("IABTCF_VendorConsents", "") ?: ""
val vendorLI = prefs.getString("IABTCF_VendorLegitimateInterests", "") ?: ""
val purposeLI = prefs.getString("IABTCF_PurposeLegitimateInterests", "") ?: ""
val googleId = 755
val hasGoogleVendorConsent = hasAttribute(vendorConsent, index = googleId)
val hasGoogleVendorLI = hasAttribute(vendorLI, index = googleId)

return hasConsentFor(listOf(1, 3, 4), purposeConsent, hasGoogleVendorConsent)
&& hasConsentOrLegitimateInterestFor(listOf(2, 7, 9, 10), purposeConsent, purposeLI, hasGoogleVendorConsent, hasGoogleVendorLI)
}

// Check if a binary string has a "1" at position "index" (1-based)
private fun hasAttribute(input: String, index: Int): Boolean {
return input.length >= index && input[index - 1] == '1'
}

// Check if consent is given for a list of purposes
private fun hasConsentFor(purposes: List, purposeConsent: String, hasVendorConsent: Boolean): Boolean {
return purposes.all { p -> hasAttribute(purposeConsent, p) } && hasVendorConsent
}

// Check if a vendor either has consent or legitimate interest for a list of purposes
private fun hasConsentOrLegitimateInterestFor(purposes: List, purposeConsent: String, purposeLI: String, hasVendorConsent: Boolean, hasVendorLI: Boolean): Boolean {
return purposes.all { p ->
(hasVendorLI && hasAttribute(purposeLI, p)) ||
(hasVendorConsent &&  hasAttribute(purposeConsent, p))
}
}
Und auch das:

Code: Select all

/**
* Checks the stored IABTCF configuration and returns one of the values defined in [AdConfiguration],
* based on the necessary minimum consent/interest defined here: https://support.google.com/admob/answer/9760862
*/
fun detectAdConfiguration(context: Context): AdConfiguration {
// default string for "no consent", used in cases where no configuration has previously been stored
val defaultPurposeString = "0000000000"
// IABTCF strings are stored in SharedPreferences
val sharedPrefs = PreferenceUtil.getDefaultSharedPreferences(context)
// https://developers.google.com/admob/android/privacy/ad-serving-modes
//limited ads: nothing for 1, consent/legitimate:  2,7,9,10
//non personalized ads: Consent: 1  , consent/legitimate:  2,7,9,10
//personalized: consent: 1,3,4 consent/legitimate:  2,7,9,10
//
// relevant strings are those for purpose consent or legitimate interest, as well as vendors
val tcConsentString = sharedPrefs
.getString("IABTCF_PurposeConsents", defaultPurposeString) ?: defaultPurposeString
val tcInterestString = sharedPrefs
.getString("IABTCF_PurposeLegitimateInterests", defaultPurposeString)
?: defaultPurposeString
//                Log.d("AppLog", "detectAdConfiguration tcConsentString:$tcConsentString tcInterestString:$tcInterestString tcVendorString:$tcVendorString ")
// in any case we need at least legitimate interest for purposes N = 2, 7, 9 and 10,
// stored in positions N-1 of either purpose string:
val sufficientInterest =
(tcConsentString.getOrNull(1) == '1' || tcInterestString.getOrNull(1) == '1') &&
(tcConsentString.getOrNull(6) == '1' || tcInterestString.getOrNull(6) == '1') &&
(tcConsentString.getOrNull(8) == '1' || tcInterestString.getOrNull(8) == '1') &&
(tcConsentString.getOrNull(9) == '1' || tcInterestString.getOrNull(9) == '1')
if (!sufficientInterest) {
return AdConfiguration.None
}
val tcVendorString = sharedPrefs.getString("IABTCF_VendorConsents", "0") ?: "0"
//        Log.d("AppLog", "tcVendorString:$tcVendorString")
// TODO vendor configuration is variable, so needs to be defined by the individual developer
//   - run app and make sure that a valid configuration is stored
//   - have the app log the value of [tcVendorString], then copy that value to the following line
//   - repeat if ad configuration changes, perhaps make this value available via remote configuration instead
val goodVendorConfiguration = context.getString(R.string.ad_consent_expected_good_vendor_configuration)
// if the stored string is shorter than what is necessary, at least some vendors will not be
// configured properly.
if (tcVendorString.length < goodVendorConfiguration.length) {
return AdConfiguration.Unclear
}
// we need consent for the following purposes N, stored in positions N-1 of the consent string:
//   1, 3 and 4 to show all ads
//   1 to show non-personalized ads
//   no consent to show limited ads
val maxAdDisplayConfiguration = when {
tcConsentString.getOrNull(0) != '1' -> AdConfiguration.Limited
tcConsentString.getOrNull(2) == '1' && tcConsentString.getOrNull(3) == '1' -> AdConfiguration.All
else -> AdConfiguration.NonPersonalized
}
// build a regex that must match all '1' but not the '0' characters in goodVendorConfiguration,
// and allows this configuration to be shorter than the string it is compared with
val vendorRegex = Regex(goodVendorConfiguration.replace("0", ".").plus(".*"))
//if the regex matches, at least some ads should be served; if not, vendor string is unclear
return if (vendorRegex.matches(tcVendorString)) {
maxAdDisplayConfiguration
} else {
return AdConfiguration.Unclear
}
}
Aber ich denke, ich kann diese nur zur Erkennung für Admob verwenden und nicht speziell für die verschiedenen Anzeigenquellen. Außerdem gilt es nur für die DSGVO und nicht auch für US-Vorschriften.
Ich habe auch versucht, Admob- und Ad-Sourecs-Unternehmen diesbezüglich um Hilfe zu bitten, aber sie geben die Verantwortung dafür einfach an die anderen ab Seite, und ich bin in der Mitte...
Die Fragen
  • Angesichts einer Anzeige- Quelle X aus der Liste der unterstützten Anzeigenquellen der Admob-Medaition, wie kann Ich mache es auf die wahren Werte sowohl der DSGVO als auch der USA aufmerksam, da ich sie aus dem UMP SDK von Google erhalte?
  • Wenn ich möchte Wäre es dort streng, würde es alle Länder der Welt betreffen oder nur diejenigen, die von diesen Regeln betroffen sind?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post