update: GuruConsent:

【Unity】-【变现】非 EEA地区国家,Adjust 默认打开ad_user_data/ad_personalization
【Unity】-【变现】Adjust DMA不传 ad_user_data
deeplink
胡宇飞 2024-03-14 13:00:50 +08:00
parent c5851880c1
commit 277bf0bfba
2 changed files with 37 additions and 6 deletions

View File

@ -54,6 +54,12 @@ namespace Guru
{ {
// No EEA countries skip reporting the data // No EEA countries skip reporting the data
Debug.Log($"{Tag} --- GoogleDMAHelper:: User is not at EEA countries, purposes: {value}"); 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; return;
} }
@ -87,17 +93,42 @@ namespace Guru
FirebaseAnalytics.SetConsent(consentData); FirebaseAnalytics.SetConsent(consentData);
//---------- Adjust report -------------- //---------- Adjust report --------------
AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); // AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null);
adjustThirdPartySharing.addGranularOption("google_dma", "eea", "1"); // adjustThirdPartySharing.addGranularOption("google_dma", "eea", "1");
adjustThirdPartySharing.addGranularOption("google_dma", "ad_personalization", $"{result[2]}"); // 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. // // 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); // Adjust.trackThirdPartySharing(adjustThirdPartySharing);
ReportAdjustDMAValue(true, result[2].ToString(), result[3].ToString());
//----------- Guru DMA report --------------- //----------- Guru DMA report ---------------
ReportResult(purposeStr, result); 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) private static void ReportResult(string purposeStr, string result)
{ {
if (!string.IsNullOrEmpty(DmaResult) && DmaResult == result) if (!string.IsNullOrEmpty(DmaResult) && DmaResult == result)

View File

@ -12,7 +12,7 @@ namespace Guru
public class GuruConsent public class GuruConsent
{ {
// Guru Consent Version // Guru Consent Version
public static string Version = "1.0.6"; public static string Version = "1.0.7";
public static string Tag = "[GuruConsent]"; public static string Tag = "[GuruConsent]";
#region 公用接口 #region 公用接口