diff --git a/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs b/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs index 5b93cbd..51ab9db 100644 --- a/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs +++ b/Runtime/GuruConsent/Runtime/Script/Consent/GoogleDMAHelper.cs @@ -15,6 +15,8 @@ namespace Guru /// public class GoogleDMAHelper { + private static string Tag => GuruConsent.Tag; + public static readonly bool UsingDelayAppMeasurement = false; public static List PurposesRules = new List @@ -33,9 +35,12 @@ namespace Guru { "at", "be", "bg", "hr", "cy", "cz", "dk", "ee", "fi", "fr", "de", "el", "hu", "ie", "it", "lv", "lt", "lu", "mt", "nl", "pl", "pt", "ro", "sk", "si", "es", "se", "no", "is", "li" }; - - private static string Tag => GuruConsent.Tag; - + + private static string DmaResult + { + get => PlayerPrefs.GetString(nameof(DmaResult), ""); + set => PlayerPrefs.SetString(nameof(DmaResult), value); + } /// /// Set DMA status @@ -88,6 +93,21 @@ namespace Guru adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", $"{result[3]}"); Adjust.trackThirdPartySharing(adjustThirdPartySharing); + //----------- Guru DMA report --------------- + ReportResult(purposeStr, result); + } + + + private static void ReportResult(string purposeStr, string result) + { + if (!string.IsNullOrEmpty(DmaResult) && DmaResult == result) + { + // result nochange will not report the event; + return; + } + + DmaResult = result; + //----------- Guru Analytics report --------------- Analytics.LogEvent("dma_gg", new Dictionary() { @@ -99,9 +119,9 @@ namespace Guru EnableFirebaseAnalytics = true, EnableFacebookAnalytics = true, }); - } + /// /// using Guru map rules to generate the result ///