SDK-গুলোর জন্য গুগল ডেভেলপার গাইডগুলো দেখুন:
- AdMob অ্যাপস ( অ্যান্ড্রয়েড , আইওএস )
- বিজ্ঞাপন ব্যবস্থাপক অ্যাপস ( অ্যান্ড্রয়েড , আইওএস )
গুগল সম্মতি মোড এসডিকে কার্যকারিতা
সামগ্রিক SDK-এর প্রয়োজনীয়তা এবং বাস্তবায়নের জন্য এই ডকুমেন্টের শুরুতে দেওয়া নির্দেশিকাগুলো দেখুন। আপনি যদি ‘প্রাইভেসি অ্যান্ড মেসেজিং’-এর ‘কনসেন্ট মোড’ সাপোর্ট চালু করে থাকেন, তাহলে এখানে বর্ণিত অতিরিক্ত কার্যকারিতাগুলোও বাস্তবায়ন করতে চাইতে পারেন।
সম্মতি মোড: বেসিক মোড সমর্থন
একবার আপনি প্রাসঙ্গিক SDK ইনস্টল করে, 'Privacy & messaging'-এ Google Consent Mode চালু করে এবং বেসিক কনসেন্ট মোড প্রয়োগ করার সিদ্ধান্ত নিলে, এই নির্দেশাবলী অনুসরণ করুন।
বেসিক মোড বাস্তবায়ন করতে:
- সাময়িকভাবে অ্যানালিটিক্স ডেটা সংগ্রহ নিষ্ক্রিয় করুন ( অ্যান্ড্রয়েড , আইওএস )।
- আপনি যখন গুগল অ্যানালিটিক্স কার্যকারিতা আনব্লক করতে প্রস্তুত হবেন, তখন অ্যানালিটিক্স সংগ্রহ পুনরায় সক্রিয় করুন ( অ্যান্ড্রয়েড , আইওএস )।
ধাপ ২-এর জন্য, অ্যানালিটিক্স কার্যকারিতা পুনরায় সক্রিয় করার মানদণ্ড নির্ধারণ করতে একজন আইন বিশেষজ্ঞের সাথে পরামর্শ করুন।
উদাহরণস্বরূপ, ব্যবহারকারী সম্মতি জানানোর পর আপনি ` loadAndShowConsentFormIfRequired এর কলব্যাকে `Google Analytics` কার্যকারিতা পুনরায় সক্রিয় করতে পারেন (API রেফারেন্স: Android , iOS )।
বিকল্পভাবে, ব্যবহারকারীর সম্মতি মোডের পছন্দের উপর ভিত্তি করে অ্যানালিটিক্স সংগ্রহ পুনরায় সক্রিয় করা হবে কিনা তা নির্ধারণ করতে, UMP_consentModeValues লোকাল স্টোরেজ কী-টি পড়ুন। এর মানটি একটি চার-সংখ্যার স্ট্রিং।
- প্রথম অঙ্কটি ad_storage উদ্দেশ্যের মান নির্দেশ করে।
- দ্বিতীয় অঙ্কটি ad_user_data উদ্দেশ্যের মান নির্দেশ করে।
- তৃতীয় অঙ্কটি ad_personalization উদ্দেশ্যের মান নির্দেশ করে।
- চতুর্থ অঙ্কটি analytics_storage উদ্দেশ্যের মান নির্দেশ করে।
নিম্নলিখিত সারণিতে প্রতিটি অঙ্কের সম্ভাব্য মানগুলি বর্ণনা করা হয়েছে:
| মূল্য | অর্থ |
|---|---|
0 | এখনও কোনো মান পাওয়া যায়নি। |
1 | ব্যবহারকারী এই উদ্দেশ্যটি GRANTED । |
2 | ব্যবহারকারী এই উদ্দেশ্যটি DENIED । |
3 | এই ব্যবহারকারীর জন্য সম্মতি মোড প্রযোজ্য নয়। |
4 | এই উদ্দেশ্যে সম্মতি মোড কনফিগার করা নেই। |
নিম্নলিখিত উদাহরণটি UMP_consentModeValues পার্স করে, যদি সমস্ত উদ্দেশ্য GRANTED হয় বা প্রযোজ্য না হয় তবে Google Analytics সক্রিয় করে, এবং অন্যথায় অ্যানালিটিক্স ডেটা সংগ্রহ নিষ্ক্রিয় করে দেয়:
জাভা
// Helper function that sets Analytics collection based on the value of the
// UMP_consentModeValues local storage key.
private void maybeReEnableAnalyticsCollection() {
String consentModeValues = sharedPreferences.getString("UMP_consentModeValues", null);
if (shouldReEnableAnalyticsCollection(consentModeValues)) {
firebaseAnalytics.setAnalyticsCollectionEnabled(true);
} else {
firebaseAnalytics.setAnalyticsCollectionEnabled(false);
}
}
// Helper function to determine whether Analytics collection should be enabled. Returns true
// if all consent mode values are either granted, not applicable, or not configured.
private boolean shouldReEnableAnalyticsCollection(String consentModeValues) {
if (consentModeValues.isEmpty()) {
return false;
}
for (int i = 0; i < consentModeValues.length(); i++) {
char consentModeValue = consentModeValues.charAt(i);
switch (consentModeValue) {
case '0':
// Consent mode data not ready yet.
return false;
case 1:
// Consent mode is granted for this purpose.
break;
case '2':
// Consent is denied for this consent mode purpose.
return false;
case '3':
// Consent does not apply for this purpose at this time.
break;
case '4':
// Consent mode is not configured for this purpose.
break;
default:
// Unexpected value encountered.
return false;
}
}
// If all checks pass, re-enable Analytics collection.
return true;
}
কোটলিন
// Helper function that may re-enable Analytics collection based on the value of the
// UMP_consentModeValues local storage key.
private fun maybeReEnableAnalyticsCollection() {
val consentModeValues = sharedPreferences.getString("UMP_consentModeValues", null)
if (shouldReEnableAnalyticsCollection(consentModeValues)) {
firebaseAnalytics.setAnalyticsCollectionEnabled(true)
}
}
// Helper function to determine whether Analytics collection should be re-enabled. Returns true
// if all consent mode values are either granted, not applicable, or not configured.
private fun shouldReEnableAnalyticsCollection(consentModeValues: String?): Boolean {
if (consentModeValues.isNullOrEmpty()) {
return false
}
for (consentModeValue in consentModeValues) {
when (consentModeValue) {
'0' -> {
// Consent mode data not ready yet.
return false
}
'1' -> {
// Consent mode is granted for this purpose.
}
'2' -> {
// Consent is denied for this consent mode purpose.
return false
}
'3' -> {
// Consent does not apply for this purpose at this time.
}
'4' -> {
// Consent mode is not configured for this purpose.
}
else -> {
// Unexpected value encountered.
return false
}
}
}
// If all checks pass, can re-enable Analytics collection.
return true
}
সুইফট
// Helper function that may re-enable Analytics collection based on the value of the
// UMP_consentModeValues local storage key.
private func maybeReEnableAnalyticsCollection() {
let consentModeValues = userDefaults.string(forKey: "UMP_consentModeValues")
if shouldReEnableAnalyticsCollection(consentModeValues) {
Analytics.setAnalyticsCollectionEnabled(true)
}
}
// Helper function to determine whether Analytics collection should be re-enabled. Returns true
// if all consent mode values are either granted, not applicable, or not configured.
private func shouldReEnableAnalyticsCollection(_ consentModeValues: String?) -> Bool {
guard let consentModeValues = consentModeValues, !consentModeValues.isEmpty else {
return false
}
for consentModeValue in consentModeValues {
switch consentModeValue {
case "0":
// Consent mode data not ready yet.
return false
case "1":
// Consent mode is granted for this purpose.
break
case "2":
// Consent is denied for this consent mode purpose.
return false
case "3":
// Consent does not apply for this purpose at this time.
break
case "4":
// Consent mode is not configured for this purpose.
break
default:
// Unexpected value encountered.
return false
}
}
// If all checks pass, can re-enable Analytics collection.
return true
}
উদ্দেশ্য-সি
// Helper function that may re-enable Analytics collection based on the value of the
// UMP_consentModeValues local storage key.
- (void)maybeReEnableAnalyticsCollection {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *consentModeValues = [defaults stringForKey:@"UMP_consentModeValues"];
if ([self shouldReEnableAnalyticsCollection:consentModeValues]) {
[FIRAnalytics setAnalyticsCollectionEnabled:YES];
}
}
// Helper function to determine whether Analytics collection should be re-enabled. Returns true
// if all consent mode values are either granted, not applicable, or not configured.
- (BOOL)shouldReEnableAnalyticsCollection:(NSString *)consentModeValues {
if (!consentModeValues || [consentModeValues length] == 0) {
return NO;
}
for (NSUInteger i = 0; i < [consentModeValues length]; i++) {
unichar consentModeValue = [consentModeValues characterAtIndex:i];
switch (consentModeValue) {
case '0':
// Consent mode data not ready yet.
return NO;
case '1':
// Consent mode is granted for this purpose.
break;
case '2':
// Consent is denied for this consent mode purpose.
return NO;
case '3':
// Consent does not apply for this purpose at this time.
break;
case '4':
// Consent mode is not configured for this purpose.
break;
default:
// Unexpected value encountered.
return NO;
}
}
// If all checks pass, can re-enable Analytics collection.
return YES;
}
যখন: maybeReEnableAnalyticsCollection কে কল করুন:
- সম্মতির তথ্য আপডেট করা হয়েছে
- সম্মতি সংগ্রহ করা হয়েছে।