admob adjust收益上报
This commit is contained in:
parent
40226c370f
commit
c836a5b38f
|
@ -260,7 +260,7 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
|
||||
private void OnSplashAdDismissed(string adUnitId)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void OnSplashAdError(string adUnitId, int errorCode, string errorMsg)
|
||||
|
@ -335,15 +335,15 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
{
|
||||
_admobBannerAdManager.ShowHighestPayingAd();
|
||||
}
|
||||
|
||||
|
||||
private void OnBannerAdLoaded(string adUnitId)
|
||||
{
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void OnBannerAdLoadFailed(string adUnitId, int errorCode, string errorMsg)
|
||||
{
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@ -353,11 +353,20 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
}
|
||||
|
||||
private void OnBannerAdPaid(AdValue adValue)
|
||||
{
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 收益上报
|
||||
public static void TrackAdImpression(AdapterResponseInfo loadedAdapterResponseInfo, AdValue adValue, AdsType type,string placement)
|
||||
{
|
||||
AdjustTrackEvent.Instance.TrackAdEvent(adValue.Value / 1000000f,loadedAdapterResponseInfo.AdSourceName,placement,loadedAdapterResponseInfo.AdSourceInstanceName);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,6 +65,10 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
bannerAds.OnAdPaid += ((adValue) =>
|
||||
{
|
||||
LoggerUtils.Debug($"[Admob] banner -[interaction]: {adUnitId} show");
|
||||
AdmobAdsManager.TrackAdImpression(bannerAds.GetResponseInfo().GetLoadedAdapterResponseInfo(),
|
||||
adValue,
|
||||
AdsType.Banner,
|
||||
AdmobUtils.ParseResponseInfo(bannerAds.GetResponseInfo()));
|
||||
OnAdPaid?.Invoke(adValue);
|
||||
});
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using GoogleMobileAds.Api;
|
||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils;
|
||||
using Script.Utils;
|
||||
using SDKManager.AdsSDKManager.Constant;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||
{
|
||||
|
@ -57,7 +58,11 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
ad.OnAdPaid += (AdValue adValue) =>
|
||||
{
|
||||
LoggerUtils.Debug(String.Format("[Admob] Interstitial ad paid {0} {1}.", adValue.Value, adValue.CurrencyCode));
|
||||
// ivRevenue = adValue.Value / 1000000f;
|
||||
AdmobAdsManager.TrackAdImpression(ad.GetResponseInfo().GetLoadedAdapterResponseInfo(),
|
||||
adValue,
|
||||
AdsType.Interstitial,
|
||||
AdmobUtils.ParseResponseInfo(ad.GetResponseInfo()));
|
||||
|
||||
onAdPaid?.Invoke(adValue);
|
||||
};
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using GoogleMobileAds.Api;
|
||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils;
|
||||
using Script.Utils;
|
||||
using SDKManager.AdsSDKManager.Constant;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||
{
|
||||
|
@ -57,7 +58,10 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
ad.OnAdPaid += (AdValue adValue) =>
|
||||
{
|
||||
LoggerUtils.Debug(String.Format("[Admob] rewarded ad paid {0} {1}.", adValue.Value, adValue.CurrencyCode));
|
||||
// ivRevenue = adValue.Value / 1000000f;
|
||||
AdmobAdsManager.TrackAdImpression(ad.GetResponseInfo().GetLoadedAdapterResponseInfo(),
|
||||
adValue,
|
||||
AdsType.Rewarded,
|
||||
AdmobUtils.ParseResponseInfo(ad.GetResponseInfo()));
|
||||
onAdPaid?.Invoke(adValue);
|
||||
};
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using GoogleMobileAds.Api;
|
||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils;
|
||||
using Script.Utils;
|
||||
using SDKManager.AdsSDKManager.Constant;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||
|
@ -59,7 +60,10 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
ad.OnAdPaid += (AdValue adValue) =>
|
||||
{
|
||||
LoggerUtils.Debug(String.Format("[Admob] appopen ad paid {0} {1}.", adValue.Value, adValue.CurrencyCode));
|
||||
// ivRevenue = adValue.Value / 1000000f;
|
||||
AdmobAdsManager.TrackAdImpression(ad.GetResponseInfo().GetLoadedAdapterResponseInfo(),
|
||||
adValue,
|
||||
AdsType.Splash,
|
||||
AdmobUtils.ParseResponseInfo(ad.GetResponseInfo()));
|
||||
onAdPaid?.Invoke(adValue);
|
||||
};
|
||||
|
||||
|
|
|
@ -4,11 +4,30 @@ using System.Reflection;
|
|||
using GoogleMobileAds.Api;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils
|
||||
{
|
||||
public class AdmobUtils
|
||||
{
|
||||
public static string ParseResponseInfo(ResponseInfo responseInfo)
|
||||
{
|
||||
string pubid = "";
|
||||
|
||||
try
|
||||
{
|
||||
string responseInfoJson = responseInfo.ToString();
|
||||
JObject responseInfoObj = JObject.Parse(responseInfoJson);
|
||||
JToken loadedAdapterResponse = responseInfoObj["Response Extras"];
|
||||
|
||||
if (loadedAdapterResponse != null)
|
||||
{
|
||||
pubid = loadedAdapterResponse["mediation_group_name"]?.ToString();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return pubid;
|
||||
}
|
||||
public static double GetBannerEcpm(BannerView bannerView)
|
||||
{
|
||||
return GetEcpm(bannerView, "bannerView", "adView", BannerStack);
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3aa8138bd8fe9499e90cff5ec0ed83fe
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9cffde25188404f09b338ea8f2444e82
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,53 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DKManager.AdsSDKManager.Constant;
|
||||
using Script.Utils;
|
||||
using SDKManager.AdsSDKManager.Constant;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SDKManager.AdsSDKManager.Events.AdsEvents
|
||||
{
|
||||
public class AdsActionEvents
|
||||
{
|
||||
public static void TrackAdClicked(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void TrackAdClosed(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void TrackAdStartLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void TrackAdLoaded(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime)
|
||||
{
|
||||
|
||||
}
|
||||
public static void TrackAdFailToLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime, string reason)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void TrackAdFailToShow(PlatformType adPlatform, AdsType adFormat, string reason, string pos)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void TrackAdPosition(PlatformType adPlatform, AdsType adFormat, string pos)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void TrackAdImpression(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 119ab55aa6c4f47b4b70af88ad977987
|
Loading…
Reference in New Issue