修复topon loaded参数为0/快手激励切屏发放奖励/数数属性上报/admob开屏收益获取不到问题,adjust改为生产环境
This commit is contained in:
parent
799a2b32eb
commit
87de004f3d
|
@ -1,5 +1,7 @@
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using AdjustSdk;
|
using AdjustSdk;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
@ -7,17 +9,14 @@ using WZ;
|
||||||
|
|
||||||
public class AdjustManager : D_MonoSingleton<AdjustManager>
|
public class AdjustManager : D_MonoSingleton<AdjustManager>
|
||||||
{
|
{
|
||||||
private AdjustEnvironment environment = AdjustEnvironment.Sandbox; // 测试用Sandbox,发布用Production
|
private AdjustEnvironment environment = AdjustEnvironment.Production;
|
||||||
|
|
||||||
private long startTime = 0;
|
private long startTime = 0;
|
||||||
|
|
||||||
private string Adid;
|
private string Adid;
|
||||||
private string Gdid;
|
private string Gdid;
|
||||||
|
private string callbackNetwork = "";
|
||||||
private string _adNetwork = "_adNetwork";
|
bool m_start = false;
|
||||||
private string _campaign = "_campaign";
|
private int callGetTimes = 0;
|
||||||
private string _adgroup = "_adgroup";
|
|
||||||
private string _creative = "_creative";
|
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
|
@ -39,13 +38,11 @@ public class AdjustManager : D_MonoSingleton<AdjustManager>
|
||||||
LoadAdid();
|
LoadAdid();
|
||||||
LoadGaid();
|
LoadGaid();
|
||||||
|
|
||||||
//计时3分钟
|
|
||||||
AppSDKManager.Instance.Coroutine(AdjustNetwork.Instance.SetOrganic3Min());
|
|
||||||
|
|
||||||
ShuShuEvent.Instance.Track("adjust_init");
|
ShuShuEvent.Instance.Track("adjust_init");
|
||||||
FireBaseAnalyticsManager.Instance.LogEvent("adjust_init");
|
FireBaseAnalyticsManager.Instance.LogEvent("adjust_init");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 归因信息
|
/// 归因信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -53,50 +50,112 @@ public class AdjustManager : D_MonoSingleton<AdjustManager>
|
||||||
private void AttributionChangedDelegate(AdjustAttribution attribution)
|
private void AttributionChangedDelegate(AdjustAttribution attribution)
|
||||||
{
|
{
|
||||||
Debug.Log("Attribution changed network: " + attribution.Network + " campaign: " + attribution.Campaign + " adgroup: " + attribution.Adgroup + " creative: " + attribution.Creative);
|
Debug.Log("Attribution changed network: " + attribution.Network + " campaign: " + attribution.Campaign + " adgroup: " + attribution.Adgroup + " creative: " + attribution.Creative);
|
||||||
|
if (m_start) return;
|
||||||
|
m_start = true;
|
||||||
|
callbackNetwork = attribution.Network;
|
||||||
|
if (IsOrganic(attribution.Network) == false)
|
||||||
|
{
|
||||||
|
OnReceiveCallback(attribution);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
InvokeRepeating(nameof(CallGetAttributionAsync), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task CallGetAttributionAsync()
|
||||||
|
{
|
||||||
|
callGetTimes++;
|
||||||
|
|
||||||
|
AdjustAttribution attribute = await GetAttributionAsync();
|
||||||
|
LoggerUtils.Debug("[adjust] adjust CallGetAttribution callGetTimes : " + callGetTimes + " attinfo:" + attribute.Network + " clicklabel:" + attribute.ClickLabel);
|
||||||
|
if (attribute != null)
|
||||||
|
{
|
||||||
|
LoggerUtils.Debug("[adjust] adjust 重试次数 : " + callGetTimes + ", attribute : " + attribute.Network + ", callbackNetwork : " + callbackNetwork);
|
||||||
|
if (attribute.Network.Equals(callbackNetwork) == false)
|
||||||
|
{
|
||||||
|
CancelInvoke(nameof(CallGetAttributionAsync));
|
||||||
|
OnReceiveCallback(attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callGetTimes >= 3*60)
|
||||||
|
{
|
||||||
|
if (attribute != null)
|
||||||
|
{
|
||||||
|
OnReceiveCallback(attribute);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnReceiveCallback(null);
|
||||||
|
}
|
||||||
|
CancelInvoke(nameof(CallGetAttributionAsync));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Task<AdjustAttribution> GetAttributionAsync()
|
||||||
|
{
|
||||||
|
var tcs = new TaskCompletionSource<AdjustAttribution>();
|
||||||
|
|
||||||
|
Adjust.GetAttribution(attribution =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tcs.TrySetResult(attribution);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
tcs.TrySetException(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return tcs.Task;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnReceiveCallback(AdjustAttribution attribution)
|
||||||
|
{
|
||||||
|
string campaign = "";
|
||||||
|
string adgroup = "";
|
||||||
|
string creative = "";
|
||||||
|
string network = "";
|
||||||
|
|
||||||
|
if (attribution != null)
|
||||||
|
{
|
||||||
|
campaign = attribution.Campaign;
|
||||||
|
adgroup = attribution.Adgroup;
|
||||||
|
creative = attribution.Creative;
|
||||||
|
network = attribution.Network;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
network = "Organic";
|
||||||
|
}
|
||||||
|
|
||||||
AdjustNetwork.Instance.SetNetwork(attribution.Network);
|
AdjustNetwork.Instance.SetNetwork(attribution.Network);
|
||||||
SaveProperties(attribution);
|
AdjustNetwork.Instance.LogEventGetSuccess();
|
||||||
|
ShuShuEvent.Instance.UserSet(new Dictionary<string, object>
|
||||||
|
{
|
||||||
|
{ "user_ad_network", network ?? "" },
|
||||||
|
{ "user_campaign", campaign ?? "" },
|
||||||
|
{ "user_adgroup", adgroup ?? "" },
|
||||||
|
{ "user_creative", creative ?? "" },
|
||||||
|
});
|
||||||
|
|
||||||
var userProperties = new Dictionary<string, object>();
|
AppSDKManager.Instance.SetSuperProperties(new Dictionary<string, object>
|
||||||
userProperties.Add("ad_network", AdjustManager.GetAdNetwork());
|
{
|
||||||
userProperties.Add("campaign", AdjustManager.GetCampaign());
|
{ "ad_network", network ?? "" },
|
||||||
userProperties.Add("adgroup", AdjustManager.GetAdgroup());
|
{ "campaign", campaign ?? "" },
|
||||||
userProperties.Add("creative", AdjustManager.GetCreative());
|
{ "adgroup", adgroup ?? "" },
|
||||||
ShuShuEvent.Instance.UserSet(userProperties);
|
{ "creative", creative ?? "" },
|
||||||
|
});
|
||||||
var publicProperties = new Dictionary<string, object>();
|
|
||||||
publicProperties.Add("user_ad_network", AdjustManager.GetAdNetwork());
|
|
||||||
publicProperties.Add("user_campaign", AdjustManager.GetCampaign());
|
|
||||||
publicProperties.Add("user_adgroup", AdjustManager.GetAdgroup());
|
|
||||||
publicProperties.Add("user_creative", AdjustManager.GetCreative());
|
|
||||||
AppSDKManager.Instance.SetSuperProperties(publicProperties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveProperties(AdjustAttribution attribution)
|
|
||||||
{
|
|
||||||
PlayerPrefsUtils.SavePlayerPrefsString(_adNetwork, attribution.Network.Substring(0, 10));
|
|
||||||
PlayerPrefsUtils.SavePlayerPrefsString(_campaign, attribution.Campaign.Substring(0, 20));
|
|
||||||
PlayerPrefsUtils.SavePlayerPrefsString(_adgroup, attribution.Adgroup.Substring(0, 10));
|
|
||||||
PlayerPrefsUtils.SavePlayerPrefsString(_creative, attribution.Creative.Substring(0, 20));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetAdNetwork()
|
private bool IsOrganic(string _network)
|
||||||
{
|
{
|
||||||
return PlayerPrefsUtils.GetPlayerPrefsString(AdjustManager.Instance._adNetwork, "");
|
if (_network.Equals("Organic") || _network.Equals("Untrusted Devices") || _network.Equals(""))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
public static string GetCampaign()
|
|
||||||
{
|
|
||||||
return PlayerPrefsUtils.GetPlayerPrefsString(AdjustManager.Instance._campaign, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetAdgroup()
|
|
||||||
{
|
|
||||||
return PlayerPrefsUtils.GetPlayerPrefsString(AdjustManager.Instance._adgroup, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetCreative()
|
|
||||||
{
|
|
||||||
return PlayerPrefsUtils.GetPlayerPrefsString(AdjustManager.Instance._creative, "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public long GetStartTime()
|
public long GetStartTime()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using AdjustSdk;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using WZ;
|
using WZ;
|
||||||
|
|
||||||
|
@ -29,31 +29,6 @@ public class AdjustNetwork : D_MonoSingleton<AdjustNetwork>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 3分钟设置自然量
|
|
||||||
/// </summary>
|
|
||||||
public IEnumerator SetOrganic3Min()
|
|
||||||
{
|
|
||||||
string curNetwork = PlayerPrefs.GetString(KEY_USER_NETWORK, "");
|
|
||||||
if (!string.IsNullOrEmpty(curNetwork))
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//写死3分钟
|
|
||||||
yield return new WaitForSeconds(3 * 60);
|
|
||||||
|
|
||||||
//重新获取
|
|
||||||
curNetwork = PlayerPrefs.GetString(KEY_USER_NETWORK, "");
|
|
||||||
if (!string.IsNullOrEmpty(curNetwork))
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
|
|
||||||
LogEventGetSuccess();
|
|
||||||
PlayerPrefs.SetString(KEY_USER_NETWORK, "Organic");
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否是自然量用户
|
/// 是否是自然量用户
|
||||||
|
@ -85,7 +60,7 @@ public class AdjustNetwork : D_MonoSingleton<AdjustNetwork>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取adjust信息成功
|
/// 获取adjust信息成功
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void LogEventGetSuccess()
|
public void LogEventGetSuccess()
|
||||||
{
|
{
|
||||||
long startTime = AdjustManager.Instance.GetStartTime();
|
long startTime = AdjustManager.Instance.GetStartTime();
|
||||||
long endTime = TimeUtils.GetLocalTimestamp();
|
long endTime = TimeUtils.GetLocalTimestamp();
|
||||||
|
|
|
@ -148,7 +148,7 @@ namespace WZ
|
||||||
public string GetHighestPayingAdUnit()
|
public string GetHighestPayingAdUnit()
|
||||||
{
|
{
|
||||||
string highestPayingAdUnit = null;
|
string highestPayingAdUnit = null;
|
||||||
double highestRevenue = 0;
|
double highestRevenue = -1;
|
||||||
|
|
||||||
foreach (var kvp in _adRevenueCache)
|
foreach (var kvp in _adRevenueCache)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace WZ
|
||||||
}
|
}
|
||||||
|
|
||||||
LoggerUtils.Debug("[Admob] appopen ad loaded with response : " + ad.GetResponseInfo().ToString()+" revenue:"+AdmobUtils.GetAppOpenAdEcpm(ad));
|
LoggerUtils.Debug("[Admob] appopen ad loaded with response : " + ad.GetResponseInfo().ToString()+" revenue:"+AdmobUtils.GetAppOpenAdEcpm(ad));
|
||||||
|
LoggerUtils.Debug("[Admob] appopen ad loaded with revenue : " + AdmobUtils.GetAppOpenAdEcpm(ad));
|
||||||
_appOpenAds[adUnitId] = ad;
|
_appOpenAds[adUnitId] = ad;
|
||||||
_adRevenueCache[adUnitId] = AdmobUtils.GetAppOpenAdEcpm(ad);
|
_adRevenueCache[adUnitId] = AdmobUtils.GetAppOpenAdEcpm(ad);
|
||||||
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Splash);
|
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Splash);
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace WZ
|
||||||
|
|
||||||
|
|
||||||
private static readonly string[] BannerStack = { "zza", "zzj", "zzi", "zze", "zza", "zzk", "zzae" };
|
private static readonly string[] BannerStack = { "zza", "zzj", "zzi", "zze", "zza", "zzk", "zzae" };
|
||||||
private static readonly string[] SpStack = { "zzb", "zzi", "zze", "zze", "zzae" };
|
private static readonly string[] SpStack = { "zzb", "zza", "zzc", "zza", "zzk", "zzae" };
|
||||||
private static readonly string[] IvStack = { "zzc", "zzj", "zzf", "zzd", "zzae" };
|
private static readonly string[] IvStack = { "zzc", "zzj", "zzf", "zzd", "zzae" };
|
||||||
private static readonly string[] RvStack = { "zzb", "zzi", "zze", "zze", "zzae" };
|
private static readonly string[] RvStack = { "zzb", "zzi", "zze", "zze", "zzae" };
|
||||||
private static readonly string[] NaStack = { "zza", "zzb", "zzf", "zzD", "zzb", "zzae" };
|
private static readonly string[] NaStack = { "zza", "zzb", "zzf", "zzD", "zzb", "zzae" };
|
||||||
|
|
|
@ -30,8 +30,8 @@ namespace WZ
|
||||||
public float _ivStartLoadTime = 0;
|
public float _ivStartLoadTime = 0;
|
||||||
public string ClientName => "Kwai";
|
public string ClientName => "Kwai";
|
||||||
public PlatformType Platfrom => PlatformType.Kwai;
|
public PlatformType Platfrom => PlatformType.Kwai;
|
||||||
|
|
||||||
public bool _initialized { get; private set; } = false;
|
public bool _initialized { get; private set; } = false;
|
||||||
|
public bool _receivedReward = false;
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,8 +25,9 @@ namespace WZ
|
||||||
AdsType.Rewarded,
|
AdsType.Rewarded,
|
||||||
"",
|
"",
|
||||||
KwaiAdsManager.Instance._rewardAdRevenue);
|
KwaiAdsManager.Instance._rewardAdRevenue);
|
||||||
KwaiAdsManager.Instance._rvCloseCallback?.Invoke(true, KwaiAdsManager.Instance._rewardAdRevenue);
|
KwaiAdsManager.Instance._rvCloseCallback?.Invoke(KwaiAdsManager.Instance._receivedReward, KwaiAdsManager.Instance._rewardAdRevenue);
|
||||||
KwaiAdsManager.Instance._rvCloseCallback = null;
|
KwaiAdsManager.Instance._rvCloseCallback = null;
|
||||||
|
KwaiAdsManager.Instance._receivedReward = false;
|
||||||
KwaiAdsManager.Instance.LoadRewarded();
|
KwaiAdsManager.Instance.LoadRewarded();
|
||||||
LoggerUtils.Debug("[kwai] RewardAdListener#OnAdClose");
|
LoggerUtils.Debug("[kwai] RewardAdListener#OnAdClose");
|
||||||
}
|
}
|
||||||
|
@ -57,6 +58,7 @@ namespace WZ
|
||||||
{
|
{
|
||||||
// 获取到激励 | Reward earned
|
// 获取到激励 | Reward earned
|
||||||
LoggerUtils.Debug("[kwai] RewardAdListener#OnRewardEarned");
|
LoggerUtils.Debug("[kwai] RewardAdListener#OnRewardEarned");
|
||||||
|
KwaiAdsManager.Instance._receivedReward = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -114,20 +114,27 @@ namespace WZ
|
||||||
#region 代理
|
#region 代理
|
||||||
private void OnAdLoadedEvent(object sender, ATAdEventArgs erg)
|
private void OnAdLoadedEvent(object sender, ATAdEventArgs erg)
|
||||||
{
|
{
|
||||||
AdsActionEvents.TrackAdLoaded(Platfrom,
|
|
||||||
ClientName + "_" + erg.callbackInfo.network_firm_id,
|
|
||||||
erg.callbackInfo.adunit_id,
|
|
||||||
erg.placementId.Equals(_topon_rewarded_units) ? AdsType.Rewarded : AdsType.Interstitial,
|
|
||||||
0);
|
|
||||||
|
|
||||||
if (erg.placementId.Equals(_topon_interstitial_units))
|
if (erg.placementId.Equals(_topon_interstitial_units))
|
||||||
{
|
{
|
||||||
LoggerUtils.Debug("[Tpn] ads tpn topon interstitial loaded");
|
LoggerUtils.Debug("[Tpn] ads tpn topon interstitial loaded");
|
||||||
|
var info = JsonUtility.FromJson<TopOnCallback>(ATInterstitialAutoAd.Instance.checkAutoAdStatus(erg.placementId));
|
||||||
|
AdsActionEvents.TrackAdLoaded(Platfrom,
|
||||||
|
ClientName + "_" + info.adInfo.network_firm_id,
|
||||||
|
info.adInfo.adunit_id,
|
||||||
|
erg.placementId.Equals(_topon_rewarded_units) ? AdsType.Rewarded : AdsType.Interstitial,
|
||||||
|
0);
|
||||||
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Interstitial);
|
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Interstitial);
|
||||||
}
|
}
|
||||||
else if (erg.placementId.Equals(_topon_rewarded_units))
|
else if (erg.placementId.Equals(_topon_rewarded_units))
|
||||||
{
|
{
|
||||||
LoggerUtils.Debug("[Tpn] ads tpn topon rewarded loaded");
|
LoggerUtils.Debug("[Tpn] ads tpn topon rewarded loaded");
|
||||||
|
var info = JsonUtility.FromJson<TopOnCallback>(ATRewardedAutoVideo.Instance.checkAutoAdStatus(erg.placementId));
|
||||||
|
AdsActionEvents.TrackAdLoaded(Platfrom,
|
||||||
|
ClientName + "_" + info.adInfo.network_firm_id,
|
||||||
|
info.adInfo.adunit_id,
|
||||||
|
erg.placementId.Equals(_topon_rewarded_units) ? AdsType.Rewarded : AdsType.Interstitial,
|
||||||
|
0);
|
||||||
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Rewarded);
|
AdsKeyEvents.Instance.LogAdFPUEvents(AdsType.Rewarded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,5 +321,22 @@ namespace WZ
|
||||||
AdPlayCountManager.GetAdPlayCount(erg.placementId.Equals(_topon_rewarded_units) ? AdsType.Rewarded : AdsType.Interstitial));
|
AdPlayCountManager.GetAdPlayCount(erg.placementId.Equals(_topon_rewarded_units) ? AdsType.Rewarded : AdsType.Interstitial));
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class TopOnCallback
|
||||||
|
{
|
||||||
|
public bool isLoading;
|
||||||
|
public bool isReady;
|
||||||
|
public TopOnCallbackInfo adInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class TopOnCallbackInfo
|
||||||
|
{
|
||||||
|
public double publisher_revenue;
|
||||||
|
public string adunit_id;
|
||||||
|
public int network_firm_id;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,10 +18,10 @@ public class AppSDKManager : D_MonoSingleton<AppSDKManager>
|
||||||
FileParse.Parse();
|
FileParse.Parse();
|
||||||
// AdConfigParser.Parse();
|
// AdConfigParser.Parse();
|
||||||
FireBaseSDKManager.Instance.Init();
|
FireBaseSDKManager.Instance.Init();
|
||||||
|
ShuShuMangage.Instance.Init();
|
||||||
AdmobAdsManager.Instance.RefreshAdsData();
|
AdmobAdsManager.Instance.RefreshAdsData();
|
||||||
AdmobAdsManager.Instance.Initialize();
|
AdmobAdsManager.Instance.Initialize();
|
||||||
AdjustManager.Instance.Init();
|
AdjustManager.Instance.Init();
|
||||||
ShuShuMangage.Instance.Init();
|
|
||||||
AdsSDKManager.Instance.InitSDK(action);
|
AdsSDKManager.Instance.InitSDK(action);
|
||||||
EFSdkManager.Instance.Init();
|
EFSdkManager.Instance.Init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using AnyThinkAds.ThirdParty.LitJson;
|
||||||
using ThinkingData.Analytics;
|
using ThinkingData.Analytics;
|
||||||
|
|
||||||
namespace WZ
|
namespace WZ
|
||||||
|
@ -11,6 +12,7 @@ namespace WZ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void UserSet(Dictionary<string, object> dic)
|
public void UserSet(Dictionary<string, object> dic)
|
||||||
{
|
{
|
||||||
|
LoggerUtils.Debug("[shushu] userset:"+JsonMapper.ToJson(dic));
|
||||||
TDAnalytics.UserSet(dic);
|
TDAnalytics.UserSet(dic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +22,7 @@ namespace WZ
|
||||||
/// <param name="superProperties"></param>
|
/// <param name="superProperties"></param>
|
||||||
public void SetSuperProperties(Dictionary<string, object> superProperties)
|
public void SetSuperProperties(Dictionary<string, object> superProperties)
|
||||||
{
|
{
|
||||||
|
LoggerUtils.Debug("[shushu] public:"+JsonMapper.ToJson(superProperties));
|
||||||
TDAnalytics.SetSuperProperties(superProperties);//设置公共事件属性
|
TDAnalytics.SetSuperProperties(superProperties);//设置公共事件属性
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,22 +14,6 @@ namespace WZ
|
||||||
TDAnalytics.Init(StaticValue.TDAppID, StaticValue.TDServerURL);
|
TDAnalytics.Init(StaticValue.TDAppID, StaticValue.TDServerURL);
|
||||||
//开启自动采集事件
|
//开启自动采集事件
|
||||||
TDAnalytics.EnableAutoTrack(TDAutoTrackEventType.AppInstall | TDAutoTrackEventType.AppStart | TDAutoTrackEventType.AppEnd);
|
TDAnalytics.EnableAutoTrack(TDAutoTrackEventType.AppInstall | TDAutoTrackEventType.AppStart | TDAutoTrackEventType.AppEnd);
|
||||||
//如果用户已登录,可以设置用户的账号ID作为身份唯一标识
|
|
||||||
// TDAnalytics.Login("TA");
|
|
||||||
var userProperties = new Dictionary<string, object>();
|
|
||||||
userProperties.Add("ad_network", AdjustManager.GetAdNetwork());
|
|
||||||
userProperties.Add("campaign", AdjustManager.GetCampaign());
|
|
||||||
userProperties.Add("adgroup", AdjustManager.GetAdgroup());
|
|
||||||
userProperties.Add("creative", AdjustManager.GetCreative());
|
|
||||||
ShuShuEvent.Instance.UserSet(userProperties);
|
|
||||||
|
|
||||||
var publicProperties = new Dictionary<string, object>();
|
|
||||||
publicProperties.Add("user_ad_network", AdjustManager.GetAdNetwork());
|
|
||||||
publicProperties.Add("user_campaign", AdjustManager.GetCampaign());
|
|
||||||
publicProperties.Add("user_adgroup", AdjustManager.GetAdgroup());
|
|
||||||
publicProperties.Add("user_creative", AdjustManager.GetCreative());
|
|
||||||
AppSDKManager.Instance.SetSuperProperties(publicProperties);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue