fix: 修复 dma_gg 反复上报的问题. 当 tcf result 值变化的时候才会上报点位
							parent
							
								
									8d38347952
								
							
						
					
					
						commit
						2303c7acbf
					
				|  | @ -15,6 +15,8 @@ namespace Guru | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     public class GoogleDMAHelper |     public class GoogleDMAHelper | ||||||
|     { |     { | ||||||
|  |         private static string Tag => GuruConsent.Tag; | ||||||
|  |          | ||||||
|         public static readonly bool UsingDelayAppMeasurement = false; |         public static readonly bool UsingDelayAppMeasurement = false; | ||||||
| 
 | 
 | ||||||
|         public static List<string> PurposesRules = new List<string> |         public static List<string> PurposesRules = new List<string> | ||||||
|  | @ -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" |             "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> |         /// <summary> | ||||||
|         /// Set DMA status |         /// Set DMA status | ||||||
|  | @ -88,6 +93,21 @@ namespace Guru | ||||||
|             adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", $"{result[3]}"); |             adjustThirdPartySharing.addGranularOption("google_dma", "ad_user_data", $"{result[3]}"); | ||||||
|             Adjust.trackThirdPartySharing(adjustThirdPartySharing); |             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 --------------- |             //----------- Guru Analytics report --------------- | ||||||
|             Analytics.LogEvent("dma_gg", new Dictionary<string, dynamic>() |             Analytics.LogEvent("dma_gg", new Dictionary<string, dynamic>() | ||||||
|             { |             { | ||||||
|  | @ -99,9 +119,9 @@ namespace Guru | ||||||
|                 EnableFirebaseAnalytics = true, |                 EnableFirebaseAnalytics = true, | ||||||
|                 EnableFacebookAnalytics = true, |                 EnableFacebookAnalytics = true, | ||||||
|             }); |             }); | ||||||
| 
 |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|         /// <summary> |         /// <summary> | ||||||
|         /// using Guru map rules to generate the result |         /// using Guru map rules to generate the result | ||||||
|         /// </summary> |         /// </summary> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue