Google সম্মতি ব্যবস্থাপনা সমাধান SDK, Google সম্মতি ব্যবস্থাপনা সমাধান SDK

এসডিকেগুলির জন্য Google বিকাশকারী নির্দেশিকাগুলি দেখুন:


সামগ্রিক SDK প্রয়োজনীয়তা এবং বাস্তবায়নের জন্য এই নথির শুরুতে গাইডগুলির সাথে পরামর্শ করুন৷ আপনি যদি গোপনীয়তা এবং বার্তাপ্রেরণের সম্মতি মোড সমর্থন সক্ষম করে থাকেন তবে আপনি এখানে কভার করা অতিরিক্ত কার্যকারিতা বাস্তবায়ন করতে চাইতে পারেন।

আপনি প্রাসঙ্গিক SDK প্রয়োগ করার পরে, গোপনীয়তা এবং বার্তাপ্রেরণে Google সম্মতি মোড সক্ষম করার পরে এবং আপনি মৌলিক সম্মতি মোড প্রয়োগ করবেন তা নির্ধারণ করে, এই নির্দেশাবলী অনুসরণ করুন৷

মৌলিক মোড বাস্তবায়ন করতে:

  1. সাময়িকভাবে অ্যানালিটিক্স সংগ্রহ ( অ্যান্ড্রয়েড , আইওএস ) অক্ষম করুন।
  2. আপনি যখন Google Analytics কার্যকারিতা আনব্লক করতে প্রস্তুত হন, তখন Analytics সংগ্রহ পুনরায় সক্ষম করুন ( Android , iOS )।

ধাপ 2-এর জন্য, অ্যানালিটিক্স কার্যকারিতা পুনরায় সক্ষম করার জন্য আপনার মানদণ্ড নির্ধারণ করতে একজন আইনি বিশেষজ্ঞের সাথে পরামর্শ করুন।

উদাহরণস্বরূপ, loadAndShowConsentFormIfRequired (API রেফারেন্স: Android , iOS ) এর কলব্যাকে Google Analytics কার্যকারিতা পুনরায় সক্ষম করে ব্যবহারকারী একটি সম্মতি পছন্দ করার পরে আপনি Google Analytics কার্যকারিতা পুনরায় সক্ষম করতে পারেন।

বিকল্পভাবে, ব্যবহারকারীর সম্মতি মোড পছন্দের উপর ভিত্তি করে অ্যানালিটিক্স সংগ্রহ পুনরায় সক্ষম করা হবে কিনা তা নির্ধারণ করতে, UMP_consentModeValues ​​স্থানীয় স্টোরেজ কী পড়ুন। মানটি একটি চার-সংখ্যার স্ট্রিং।

  • প্রথম সংখ্যা ad_storage উদ্দেশ্য মান নির্দেশ করে
  • দ্বিতীয় সংখ্যা ad_user_data উদ্দেশ্য মান নির্দেশ করে
  • তৃতীয় সংখ্যা বিজ্ঞাপন_ব্যক্তিগতকরণের উদ্দেশ্য মান নির্দেশ করে
  • চতুর্থ সংখ্যা বিশ্লেষণ_স্টোরেজ উদ্দেশ্য মান নির্দেশ করে

নিম্নলিখিত সারণী প্রতিটি অঙ্কের সম্ভাব্য মান বর্ণনা করে:

মান অর্থ
0 কোন মান এখনও উপলব্ধ.
1 ব্যবহারকারী এই উদ্দেশ্য GRANTED .
2 ব্যবহারকারী এই উদ্দেশ্য DENIED .
3 এই ব্যবহারকারীর জন্য সম্মতি মোড প্রযোজ্য নয়।
4 এই উদ্দেশ্যে সম্মতি মোড কনফিগার করা নেই।

নিম্নলিখিত উদাহরণটি UMP_consentModeValues ​​কে পার্স করে, সমস্ত উদ্দেশ্য GRANTED হলে বা প্রযোজ্য না হলে Google Analytics সক্ষম করে এবং অন্যথায় 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
}

উদ্দেশ্য-C

// 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 কালেকশনে কল করুন যখন:

  • সম্মতি তথ্য আপডেট করা হয়
  • সম্মতি সংগ্রহ করা হয়।