fix: 修复打点发送的 target
Signed-off-by: huyufei <yufei.hu@castbox.fm>
parent
61ff5027d4
commit
959677859c
|
|
@ -207,49 +207,46 @@ namespace Guru
|
||||||
// #1 ad_impression
|
// #1 ad_impression
|
||||||
Analytics.ADImpression(data.ToAdImpressionData());
|
Analytics.ADImpression(data.ToAdImpressionData());
|
||||||
|
|
||||||
// #2 tch_001
|
// #2 tch_001 + tch_02 广告点内 tch_001 和 tch_02 都需要计算
|
||||||
double revenue = data.value;
|
double revenue = data.value;
|
||||||
CalcTch001Value(revenue);
|
AddAdsTch001Revenue(revenue);
|
||||||
CalcTch02Value(revenue);
|
AddAdsTch02Revenue(revenue);
|
||||||
|
|
||||||
// #3 adjust_ad_revenue
|
// #3 adjust_ad_revenue
|
||||||
AdjustService.Instance.TrackADRevenue(data.value, data.currency, data.adSource, data.adUnitId, data.networkPlacement);
|
AdjustService.Instance.TrackADRevenue(data.value, data.currency, data.adSource, data.adUnitId, data.networkPlacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算太极001收益
|
/// 累积计算太极001收益
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="revenue"></param>
|
/// <param name="revenue"></param>
|
||||||
private void CalcTch001Value(double revenue)
|
private void AddAdsTch001Revenue(double revenue)
|
||||||
{
|
{
|
||||||
TchAD001RevValue += revenue;
|
TchAD001RevValue += revenue;
|
||||||
double revenueValue = TchAD001RevValue;
|
double revenueValue = TchAD001RevValue;
|
||||||
// Debug.Log($"{Tag} --- [Tch] get <TchAD001RevValue> totally: {revenueValue}");
|
|
||||||
if (revenueValue >= Analytics.Tch001TargetValue)
|
if (revenueValue < Analytics.Tch001TargetValue) return;
|
||||||
{
|
|
||||||
Debug.Log($"{Tag} --- [Tch] call <tch_ad_rev_roas_001> with value: {revenueValue}");
|
Debug.Log($"{Tag} --- [Tch] call <tch_ad_rev_roas_001> with value: {revenueValue}");
|
||||||
Analytics.Tch001ADRev(revenueValue);
|
Analytics.Tch001ADRev(revenueValue);
|
||||||
TchAD001RevValue = 0.0;
|
TchAD001RevValue = 0.0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算太极02收益
|
/// 累积计算太极02收益
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="revenue"></param>
|
/// <param name="revenue"></param>
|
||||||
private void CalcTch02Value(double revenue)
|
private void AddAdsTch02Revenue(double revenue)
|
||||||
{
|
{
|
||||||
if (!Analytics.EnableTch02Event) return;
|
if (!Analytics.EnableTch02Event) return;
|
||||||
|
|
||||||
TchAD02RevValue += revenue;
|
TchAD02RevValue += revenue;
|
||||||
double revenueValue = TchAD02RevValue;
|
double revenueValue = TchAD02RevValue;
|
||||||
Debug.Log($"[Ads] get <TchAD02RevValue> totally: {revenueValue}");
|
if (revenueValue < Analytics.TCH_02_VALUE) return;
|
||||||
if (revenueValue >= Analytics.Tch02TargetValue)
|
|
||||||
{
|
Debug.Log($"{Tag} --- [Tch] call <tch_ad_rev_roas_02> with value: {revenueValue}");
|
||||||
Debug.Log($"[Ads] call <tch_ad_rev_roas_02> with value: {revenueValue}");
|
Analytics.Tch02ADRev(revenueValue);
|
||||||
Analytics.Tch02ADRev(revenueValue);
|
TchAD02RevValue = 0.0;
|
||||||
TchAD02RevValue = 0.0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ namespace Guru
|
||||||
public const string ATTOptIn = "att_opt_in";
|
public const string ATTOptIn = "att_opt_in";
|
||||||
public const string ATTOpOut = "att_opt_out";
|
public const string ATTOpOut = "att_opt_out";
|
||||||
public const string ParameterATTStatus = "att_status";
|
public const string ParameterATTStatus = "att_status";
|
||||||
public const string EventATTResult = "att_result";
|
public const string EventAttResult = "att_result";
|
||||||
|
|
||||||
// 用户属性
|
// 用户属性
|
||||||
public const string PropertyFirstOpenTime = "first_open_time"; //用户第一次first_open的时间
|
public const string PropertyFirstOpenTime = "first_open_time"; //用户第一次first_open的时间
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ namespace Guru
|
||||||
TrackEvent(eventName, extra, new EventSetting()
|
TrackEvent(eventName, extra, new EventSetting()
|
||||||
{
|
{
|
||||||
EnableFirebaseAnalytics = true,
|
EnableFirebaseAnalytics = true,
|
||||||
EnableFacebookAnalytics = true,
|
EnableGuruAnalytics = true,
|
||||||
EnableAdjustAnalytics = true
|
EnableAdjustAnalytics = true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -266,6 +266,7 @@ namespace Guru
|
||||||
|
|
||||||
#region Tch 太极打点逻辑
|
#region Tch 太极打点逻辑
|
||||||
|
|
||||||
|
public const double TCH_02_VALUE = 0.2; // tch_02 上限值
|
||||||
private static double _tch001MaxValue = 5.0d; // 预设保护值, 如果大于这个值, 算作异常上报
|
private static double _tch001MaxValue = 5.0d; // 预设保护值, 如果大于这个值, 算作异常上报
|
||||||
private static double _tch001TargetValue = 0.01d;
|
private static double _tch001TargetValue = 0.01d;
|
||||||
public static double Tch001TargetValue => _tch001TargetValue; // 太极 001 设定值
|
public static double Tch001TargetValue => _tch001TargetValue; // 太极 001 设定值
|
||||||
|
|
@ -387,7 +388,12 @@ namespace Guru
|
||||||
|
|
||||||
//--------- Extra data for IAP receipt ---------------
|
//--------- Extra data for IAP receipt ---------------
|
||||||
|
|
||||||
TrackEvent(evtName, data);
|
TrackEvent(evtName, data, new EventSetting()
|
||||||
|
{
|
||||||
|
EnableFirebaseAnalytics = true,
|
||||||
|
EnableGuruAnalytics = true,
|
||||||
|
EnableFacebookAnalytics = true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -465,6 +471,10 @@ namespace Guru
|
||||||
{ ParameterAdPlatform, AdMAX },
|
{ ParameterAdPlatform, AdMAX },
|
||||||
{ ParameterCurrency, USD },
|
{ ParameterCurrency, USD },
|
||||||
{ ParameterValue, value },
|
{ ParameterValue, value },
|
||||||
|
}, new EventSetting()
|
||||||
|
{
|
||||||
|
EnableFirebaseAnalytics = true,
|
||||||
|
EnableGuruAnalytics = true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -561,6 +571,7 @@ namespace Guru
|
||||||
TrackEvent(EventIAPReturnTrue, dict, new EventSetting()
|
TrackEvent(EventIAPReturnTrue, dict, new EventSetting()
|
||||||
{
|
{
|
||||||
EnableFirebaseAnalytics = true,
|
EnableFirebaseAnalytics = true,
|
||||||
|
EnableGuruAnalytics = true,
|
||||||
EnableAdjustAnalytics = true,
|
EnableAdjustAnalytics = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -662,6 +673,9 @@ namespace Guru
|
||||||
receipt = adata.receipt;
|
receipt = adata.receipt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------- 太极打点逻辑 -----------
|
||||||
|
// tch_001 和 tch_02 都要上报
|
||||||
|
// fb 的 purchase 事件只打一次
|
||||||
// TCH 001
|
// TCH 001
|
||||||
Tch001IAPRev(usdPrice, productId, orderId, orderType, orderDate, isTest);
|
Tch001IAPRev(usdPrice, productId, orderId, orderType, orderDate, isTest);
|
||||||
|
|
||||||
|
|
@ -670,6 +684,8 @@ namespace Guru
|
||||||
|
|
||||||
// Facebook Track IAP Purchase
|
// Facebook Track IAP Purchase
|
||||||
FBPurchase(usdPrice, USD, "iap", IAPPlatform);
|
FBPurchase(usdPrice, USD, "iap", IAPPlatform);
|
||||||
|
|
||||||
|
//---------- 太极打点逻辑 -----------
|
||||||
|
|
||||||
if (orderData.orderType == 1)
|
if (orderData.orderType == 1)
|
||||||
{
|
{
|
||||||
|
|
@ -740,7 +756,12 @@ namespace Guru
|
||||||
};
|
};
|
||||||
|
|
||||||
// 上报Firebase + 自打点
|
// 上报Firebase + 自打点
|
||||||
TrackEvent(eventName, dict, new EventSetting() { EnableFirebaseAnalytics = true });
|
TrackEvent(eventName, dict, new EventSetting()
|
||||||
|
{
|
||||||
|
EnableFirebaseAnalytics = true,
|
||||||
|
EnableGuruAnalytics = true,
|
||||||
|
EnableAdjustAnalytics = true
|
||||||
|
});
|
||||||
|
|
||||||
// 上报 Adjust 支付事件
|
// 上报 Adjust 支付事件
|
||||||
LogAdjustRevenueEvent(eventName, value, productId, orderId, purchaseToken, receipt, dict);
|
LogAdjustRevenueEvent(eventName, value, productId, orderId, purchaseToken, receipt, dict);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace Guru
|
||||||
public bool EnableFirebaseAnalytics;
|
public bool EnableFirebaseAnalytics;
|
||||||
public bool EnableAdjustAnalytics;
|
public bool EnableAdjustAnalytics;
|
||||||
public bool EnableFacebookAnalytics;
|
public bool EnableFacebookAnalytics;
|
||||||
public bool EnableGuruAnalytics;
|
public bool EnableGuruAnalytics = true; // 默认开启自打点
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue