互动广告收益上报、group_set上报

This commit is contained in:
玉峰 2025-09-02 11:07:36 +08:00
parent 5851c170db
commit ec0d77bdca
4 changed files with 51 additions and 7 deletions

View File

@ -11,6 +11,7 @@ namespace WZ
Banner,
Native,
Splash,
Okspin,
}
}

View File

@ -176,15 +176,18 @@ public class AppSDKManager : D_MonoSingleton<AppSDKManager>
/// 展示WebView
/// </summary>
/// <param name="id">标签id,存在多个WebView时,用于标识WebView</param>
/// <param name="pos">广告位</param>
/// <param name="url">网址</param>
/// <param name="pRect">WebView展示区域的RectTransform</param>
/// <param name="pCam">可不传;传值的话要传正交相机</param>
public void ShowWebView(int id, string url, RectTransform pRect, Camera pCam = null)
public void ShowWebView(int id, string pos, string url, RectTransform pRect, Camera pCam = null)
{
if (Application.isEditor)
{
return;
}
EFSdkManager.Instance.SetOkspinShowPos(pos);
EFSdk.get().ShowWebView(id, url, pRect, pCam);
}

View File

@ -6,6 +6,11 @@ namespace WZ
{
public class EFSdkManager : NormalSingleton<EFSdkManager>
{
private const string KEY_OKSPIN_SHOW_COUNT = "OKSPIN_SHOW_COUNT";
//互动广告位
private string okspinShowPos = "";
public void Init()
{
EFSdk.get().Init((actionType, str) =>
@ -54,17 +59,40 @@ namespace WZ
{
EFSdk.get().SetHdH5ImpressionCallback((url) =>
{
//TODO 判断是okspin还是appluck
//判断链接不为空
if (string.IsNullOrEmpty(url))
{
return;
}
//判断链接是互动广告
if (!url.Contains("gamifyspace"))
{
return;
}
//展示次数
int count = PlayerPrefsUtils.GetPlayerPrefsInt(KEY_OKSPIN_SHOW_COUNT, 0);
count++;
PlayerPrefsUtils.SavePlayerPrefsInt(KEY_OKSPIN_SHOW_COUNT, count);
//互动广告只有okSpin
string h5ad_okspinrev = FireBaseRemoteConfigManager.Instance.GetRemoteConfigString("H5ad_okspinrev", "0");
string h5ad_appluckrev= FireBaseRemoteConfigManager.Instance.GetRemoteConfigString("H5ad_appluckrev", "0");
//TODO 上报
double revenue = double.Parse(h5ad_okspinrev, System.Globalization.CultureInfo.InvariantCulture);
//adjust
//AdjustTrackEvent.Instance.TrackAdEvent();
AdjustTrackEvent.Instance.TrackAdEvent(revenue, "H5ad_game", url, url);
//firebase
//FireBaseAnalyticsManager.Instance.OnAdRevenueEvent();
FireBaseAnalyticsManager.Instance.OnAdRevenueEvent("H5ad_game", "H5ad_game", url, AdsType.Okspin, revenue, okspinShowPos, count);
//数数
//ShuShuEvent.Instance.OnAdRevenueEvent();
ShuShuEvent.Instance.OnAdRevenueEvent("H5ad_game", "H5ad_game", url, AdsType.Okspin.ToString(), revenue, okspinShowPos, count);
});
}
public void SetOkspinShowPos(string pos)
{
okspinShowPos = pos;
}
}
}

View File

@ -22,6 +22,9 @@ namespace WZ
AdConfigParser.Parse(GetRemoteConfigString("ad_config"));
// 刷新广告位信息
AdsSDKManager.Instance.RefreshAdsData();
//AB测试分组参数
GroupSet();
// adjust卸载监控
/* 执行到这时表示firebase接入正常能获取到远端在线参数 */
@ -37,6 +40,15 @@ namespace WZ
// });
}
private void GroupSet()
{
string value = GetRemoteConfigString("group_set");
//数数
ShuShuEvent.Instance.Track($"group_set_{value}");
//firebase
FireBaseAnalyticsManager.Instance.LogEvent($"group_set_{value}");
}
/// <summary>
/// 获取int参数