diff --git a/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs b/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs index 775dbe4..177ef5e 100644 --- a/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs +++ b/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs @@ -54,6 +54,12 @@ namespace Guru { // No EEA countries skip reporting the data Debug.Log($"{Tag} --- GoogleDMAHelper:: User is not at EEA countries, purposes: {value}"); + if (string.IsNullOrEmpty(DmaResult) || DmaResult != "not_eea" ) + { + DmaResult = "not_eea"; + ReportAdjustDMAValue(false); + return; + } return; } @@ -87,17 +93,42 @@ namespace Guru FirebaseAnalytics.SetConsent(consentData); //---------- Adjust report -------------- - AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); - adjustThirdPartySharing.addGranularOption("google_dma", "eea", "1"); - adjustThirdPartySharing.addGranularOption("google_dma", "ad_personalization", $"{result[2]}"); - adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", $"{result[3]}"); // From Haoyi's advice we don't give the value so Adjust will still receive the data as a trick. - Adjust.trackThirdPartySharing(adjustThirdPartySharing); + // AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); + // adjustThirdPartySharing.addGranularOption("google_dma", "eea", "1"); + // adjustThirdPartySharing.addGranularOption("google_dma", "ad_personalization", $"{result[2]}"); + // // adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", $"{result[3]}"); // From Haoyi's advice we don't give the value so Adjust will still receive the data as a trick. + // Adjust.trackThirdPartySharing(adjustThirdPartySharing); + + ReportAdjustDMAValue(true, result[2].ToString(), result[3].ToString()); //----------- Guru DMA report --------------- ReportResult(purposeStr, result); } + private static void ReportAdjustDMAValue(bool isEEAUser, string personalization = "1", string userData = "1") + { + AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); + + if (isEEAUser) + { + // From Haoyi's advice we don't give the value so Adjust will still receive the data as a trick. + adjustThirdPartySharing.addGranularOption("google_dma", "eea", "1"); + adjustThirdPartySharing.addGranularOption("google_dma", "ad_personalization", personalization); + // adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", userData); + } + else + { + // No eea user, all set to granted + adjustThirdPartySharing.addGranularOption("google_dma", "eea", "0"); + adjustThirdPartySharing.addGranularOption("google_dma", "ad_personalization", "1"); + adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", $"1"); + } + + Adjust.trackThirdPartySharing(adjustThirdPartySharing); + } + + private static void ReportResult(string purposeStr, string result) { if (!string.IsNullOrEmpty(DmaResult) && DmaResult == result) diff --git a/Runtime/GuruConsent/Runtime/Script/Consent/GuruConsent.cs b/Runtime/GuruConsent/Runtime/Script/Consent/GuruConsent.cs index ab9d318..96727f1 100644 --- a/Runtime/GuruConsent/Runtime/Script/Consent/GuruConsent.cs +++ b/Runtime/GuruConsent/Runtime/Script/Consent/GuruConsent.cs @@ -12,7 +12,7 @@ namespace Guru public class GuruConsent { // Guru Consent Version - public static string Version = "1.0.6"; + public static string Version = "1.0.7"; public static string Tag = "[GuruConsent]"; #region 公用接口