fix: 修复 dma_gg 反复上报的问题. 当 tcf result 值变化的时候才会上报点位
							parent
							
								
									8d38347952
								
							
						
					
					
						commit
						2303c7acbf
					
				|  | @ -15,6 +15,8 @@ namespace Guru | |||
|     /// </summary> | ||||
|     public class GoogleDMAHelper | ||||
|     { | ||||
|         private static string Tag => GuruConsent.Tag; | ||||
|          | ||||
|         public static readonly bool UsingDelayAppMeasurement = false; | ||||
| 
 | ||||
|         public static List<string> PurposesRules = new List<string> | ||||
|  | @ -34,8 +36,11 @@ 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); | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 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<string, dynamic>() | ||||
|             { | ||||
|  | @ -99,9 +119,9 @@ namespace Guru | |||
|                 EnableFirebaseAnalytics = true, | ||||
|                 EnableFacebookAnalytics = true, | ||||
|             }); | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// using Guru map rules to generate the result | ||||
|         /// </summary> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue