From c4897860384846e810f82a3cfe90031eae614555 Mon Sep 17 00:00:00 2001 From: huyufei Date: Tue, 6 Aug 2024 10:05:44 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=A7=84=E8=8C=83=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyufei --- Runtime/GuruCore/Runtime/Ads/Data/AdParams.cs | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/Runtime/GuruCore/Runtime/Ads/Data/AdParams.cs b/Runtime/GuruCore/Runtime/Ads/Data/AdParams.cs index 30bfdec..0a5a999 100644 --- a/Runtime/GuruCore/Runtime/Ads/Data/AdParams.cs +++ b/Runtime/GuruCore/Runtime/Ads/Data/AdParams.cs @@ -1,12 +1,18 @@ -using System.Collections.Generic; namespace Guru { + using System.Collections.Generic; + + /// /// 广告打点上报参数 /// public class AdParams { + private const int MAX_VALUE_LENGTH = 96; + private const string VALUE_NOT_SET = "not_set"; + + public double value; public string currency; public string category; @@ -39,9 +45,9 @@ namespace Guru var networkPlacement = ""; var creativeId = ""; var adSource = ""; - var adFormart = ""; + var adFormat = ""; double value = 0; - string waterfallName = ""; + // string waterfallName = ""; if (adInfo != null) { @@ -49,12 +55,28 @@ namespace Guru networkPlacement = adInfo.NetworkPlacement; creativeId = adInfo.CreativeIdentifier; adSource = adInfo.NetworkName; - adFormart = adInfo.AdFormat; + adFormat = adInfo.AdFormat; } if (string.IsNullOrEmpty(adPlatform)) adPlatform = Analytics.AdMAX; - if (string.IsNullOrEmpty(category)) category = "not_set"; + if (string.IsNullOrEmpty(category)) category = VALUE_NOT_SET; if (string.IsNullOrEmpty(currency)) currency = Analytics.USD; + if (string.IsNullOrEmpty(creativeId)) + { + creativeId = VALUE_NOT_SET; + } + else if(creativeId.Length > MAX_VALUE_LENGTH) + { + creativeId = creativeId.Substring(0, MAX_VALUE_LENGTH); + } + if (string.IsNullOrEmpty(reviewCreativeId)) + { + reviewCreativeId = VALUE_NOT_SET; + } + else if(reviewCreativeId.Length > MAX_VALUE_LENGTH) + { + reviewCreativeId = reviewCreativeId.Substring(0, MAX_VALUE_LENGTH); + } var p = new AdParams() { @@ -63,7 +85,7 @@ namespace Guru adUnitId = adUnitId, adPlatform = adPlatform, adSource = adSource, - adFormat = adFormart, + adFormat = adFormat, duration = duration, networkPlacement = networkPlacement, category = category,