菜单

首次事件

首次事件是指针对某些维度(设备 ID或其他维度的 ID)只记录一次的事件,例如记录某个账号的注册事件,可以使用首次事件来记录,服务端会按照 setCheckId() 设置的 ID 去重,同一 ID 只会记录第一次上报的事件。

预置事件(_appInstall、_appStart、_appEnd)不支持设置为首次事件。

方法示例

export function trackFirstEvent(firstCheckId:string,eventAttribute:
                                                  SEIAPEventAttribute|
                                                  SEAppAttrEventAttribute|
                                                  SEOrderEventAttribute|
                                                  SERegisterEventAttribute|
                                                  SELoginEventAttribute|
                                                  SEAdImpressionEventAttribute|
                                                  SEAdClickEventAttribute|
                                                  SECustomEventAttribute);
 

参数说明

参数名称 参数含义 参数类型 是否必传
firstCheckId 首次事件校验id string
eventAttribute
首次事件类
SEIAPEventAttribute|
SEAppAttrEventAttribute|
SEOrderEventAttribute|
SERegisterEventAttribute|
SELoginEventAttribute|
SEAdImpressionEventAttribute|
SEAdClickEventAttribute
SECustomEventAttribute

 

eventAttribute 参数使用时需要传 对应 的实例,具体说明如下:

首次事件 参数类型
自定义首次事件
SECustomEventAttribute
变现广告展示首次事件 SEAdImpressionEventAttribute
变现广告点击首次事件 SEAdClickEventAttribute
应用内购买首次事件 SEIAPEventAttribute
自归因安装首次事件 SEAppAttrEventAttribute
订单事件首次事件 SEOrderEventAttribute
注册事件首次事件 SERegisterEventAttribute
登录事件首次事件 SELoginEventAttribute

 

调用示例

1.变现广告展示事件首次事件

参数说明:

(各聚合平台对应传值字段参见: ROI-三方账户管理-聚合平台-其他聚合平台 )

SEAdImpressionEventAttribute 类参数说明:

参数名称 参数含义 参数类型 是否必传
adNetworkPlatform 变现平台,前面为应传值,后面为平台名称 csj:穿山甲国内版 pangle:穿山甲国际版 tencent:腾讯优量汇 baidu:百度百青藤 kuaishou:快手 oppo:OPPO vivo:vivo mi:小米 huawei:华为 applovin:Applovin sigmob:Sigmob mintegral:Mintegral oneway:OneWay vungle:Vungle facebook:Facebook admob:AdMob unity:UnityAds is:IronSource adtiming:AdTiming klein:游可赢 fyber:Fyber chartboost:Chartboost adcolony:Adcolony string
adType

所展示的广告的类型( 枚举AdType)

RewardedVideo:激励视频
Splash:开屏
Interstitial:插屏
FullscreenVideo:全屏视频
Banner:Banner
Native:信息流
NativeVideo:短视频信息流
MPUBanner:大横幅
InstreamVideo:视频贴片
MREC:中等尺寸横幅
其它广告类型,可以自定义数字(大于20,与上述类型区分开)
number
adNetworkAppID 变现平台的应用 ID string
adNetworkPlacementID 变现平台的变现广告位 ID string
mediationPlatform 聚合平台标识,常见聚合平台枚举如下,若您使用的聚合平台不在如下枚举值,您可以自定义命名,并控制字符数在32位。没有聚合平台标识,请设置为 "custom"。
max
ironsource
admob
hyperbid
topon
cas
Tradplus
Tobid
string
ecpm 广告ECPM(广告千次展现的变现收入,0或负值表示没传),单位:元/美元 number
currency 展示收益的货币种类,遵循《ISO 4217国际标准》如 CNY、USD string
rendered 广告是否渲染成功,具体枚举值如下: 例如:成功时,只需要传入 YES YES:成功 NO:失败 如果不需要统计该指标,请传 YES boolean
customProperties 自定义属性, json字符串 Object

 

调用示例

let firstCheckId = "my first check id";
let attribute:SEAdImpressionEventAttribute = {
  adNetworkPlatform:"AdMob",
  adType:AdType.Interstitial,
  adNetworkAppID:"AdMob appid",
  adNetworkPlacementID:"AdMob placementid",
  mediationPlatform:"MAX",
  currency:"USD",
  ecpm:1.234,
  rendered:true,
  customProperties:{"key1":"value1","key2":"value2"}
  // customProperties 为自定义属性,可以不设置
  // 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃    
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);

 

 

2.变现广告点击事件首次事件

SEAdClickEventAttribute 类参数说明:

 
参数名称 参数含义 参数类型 是否必传
adNetworkPlatform

变现平台,前面为应传值,后面为平台名称
csj:穿山甲国内版
pangle:穿山甲国际版
tencent:腾讯优量汇
baidu:百度百青藤
kuaishou:快手
oppo:OPPO
vivo:vivo
mi:小米
huawei:华为
applovin:Applovin
sigmob:Sigmob
mintegral:Mintegral
oneway:OneWay
vungle:Vungle
facebook:Facebook
admob:AdMob
unity:UnityAds
is:IronSource
adtiming:AdTiming
klein:游可赢
fyber:Fyber
chartboost:Chartboost
adcolony:Adcolony

string
adType

所展示的广告的类型( 枚举AdType)

RewardedVideo:激励视频
Splash:开屏
Interstitial:插屏
FullscreenVideo:全屏视频
Banner:Banner
Native:信息流
NativeVideo:短视频信息流
MPUBanner:大横幅
InstreamVideo:视频贴片
MREC:中等尺寸横幅
其它广告类型,可以自定义数字(大于20,与上述类型区分开)
number
adNetworkPlacementID 变现平台的变现广告位 ID string
mediationPlatform 聚合平台标识,常见聚合平台枚举如下,若您使用的聚合平台不在如下枚举值,您可以自定义命名,并控制字符数在32位。没有聚合平台标识,请设置为 "custom"。
max
ironsource
admob
hyperbid
topon
cas
Tradplus
Tobid
string
customProperties 自定义属性说明见目录:4.自定义属性 Object

 

调用示例

let firstCheckId = "my first check id";
let attribute:SEAdClickEventAttribute = {

  adNetworkPlatform: "AdNetwork platform",
  adType:AdType.Interstitial,
  adNetworkPlacementID:"AdNetwork placementid",
  mediationPlatform:"mediation name",
  customProperties:{"key":"adclick customProperties value"}
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
 
 

3.自归因事件首次事件

SEAppAttrEventAttribute 类参数介绍:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id string 是(如果未传checkId,则为普通事件)
adNetwork 投放广告的渠道 ID,需要与发行平台匹配 string
subChannel 投放广告的子渠道 string
adAccountID 投放广告的投放账号 ID string
adAccountName 投放广告的投放账号名称 string
adCampaignID 投放广告的广告计划 ID string
adCampaignName 投放广告的广告计划名称 string
adOfferID 投放广告的广告单元 ID string
adOfferName 投放广告的广告单元名称 string
adCreativeID 投放广告的广告创意 ID string
adCreativeName 投放广告的广告创意名称 string
attributionPlatform 监测平台 string
customProperties 开发者传入的自定义属性 Object

 

调用示例

let firstCheckId = "my first check id";
let attribute:SEAppAttrEventAttribute = {
  adNetwork:"toutiao",
  subChannel:"103300", //若无, 可以传""
  adAccountID:"1655958321988611",//若无, 可以传""
  adAccountName:"xxx科技全量18",//若无, 可以传""
  adCampaignID:"1680711982033293",//若无, 可以传""
  adCampaignName:"冲冲冲计划157-1024",//若无, 可以传""
  adOfferID:"1685219082855528",//若无, 可以传""
  adOfferName:"冲冲冲单元406-1024",//若无, 可以传""
  adCreativeID:"1680128668901378",//若无, 可以传""
  adCreativeName:"自动创建20210901178921",//若无, 可以传""
  attributionPlatform:"广告监测平台xxx",
  customProperties:{"customProperties":"app attr customProperties value"} 
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
 
 

4.登录事件首次事件

SELoginEventAttribute 类参数介绍:

参数名称 参数含义 参数类型 是否必传
loginType 登录类型如 "WeChat"、"QQ" 等自定义值 string 是,不超过 32 字符
loginStatus 登录状态 如 "success" string
customProperties 自定义属性 Object

调用示例

let firstCheckId = "my first check id";
let attribute:SELoginEventAttribute = {
    loginType:"WeChat",
    loginStatus:"failed",
    customProperties:{"key":"login customProperties value"}
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
 

 

5.注册事件首次事件

SERegisterEventAttribute 类参数介绍:

参数名称 参数含义 参数类型 是否必传
registerType 注册类型如 "WeChat"、"QQ" 等自定义值 string 是,不超过 32 字符
registerStatus 注册状态 如 "success" string
customProperties 自定义属性 Object
 

调用示例

let firstCheckId = "my first check id";
let attribute:SERegisterEventAttribute = {
  registerType:"WeChat",
  registerStatus:"success",
  customProperties:{"key":"register customProperties value"}
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
 

 

6.订单事件首次事件

SEOrderEventAttribute 类参数介绍:

参数名称 参数含义 参数类型 是否必传
orderID 订单 ID string 否,不超过 128 字符
payAmount 订单金额,单位:元/美元 number
currency 展示货币类型,遵循《ISO 4217国际标准》,如 CNY、USD string
payType 支付方式:如 alipay、weixin、applepay、paypal 等 string 否,不超过 32 字符
status 订单状态 string
customProperties 自定义属性说明见目录:4.自定义属性 Object
 

调用示例

let firstCheckId = "my first check id";
let attribute:SEOrderEventAttribute = {
  orderID:"order id",
  payAmount:3.1415926,
  currency:"USD",
  payType:Paypal,
  status:"success",
  customProperties:{"key":"order customProperties value"}
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
 

 

7.应用内购买事件首次事件

SEIAPEventAttribute 类参数说明:

参数名称 参数含义 参数类型 是否必传
orderId 本次购买由系统生成的订单 ID string
payAmount 本次购买支付的金额,单位:元/美元 number
currency 支付的货币类型,遵循《ISO 4217国际标准》,如 CNY、USD string
payType

支付方式: 可使用已定义好的常量

export const Alipay = "alipay";
export const Weixin = "weixin";
export const ApplePay = "applepay";
export const Paypal = "paypal";
如是其他支付方式,可自定义
string
productID 购买商品的ID string
productName 商品名称 string
productCount 购买商品的数量 Int
payStatus

支付状态 SEIAPStatus枚举

Success:成功
Failed:失败
Restored:恢复
SEIAPStatus
failReason 支付失败的原因 string
customProperties 自定义属性 Object
 

调用示例

let firstCheckId = "my first check id";
let attribute:SEIAPEventAttribute = {
  productID:"product id",
  productName:"product name",
  productCount:3,
  orderId:"order id",
  payAmount:3.14,
  currency:"USD",
  // const Alipay    = "alipay";
  // const Weixin    = "weixin";
  // const ApplePay  = "applepay";
  // const Paypal    = "paypal";
  payType:Paypal,
  payStatus:SEIAPStatus.Success,
  failReason:"",
  customProperties:{"key":"iap customProperties value"}
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
 

注:支付失败原因 fail_reason 参数仅在 paystatus 参数为 SEConstant_IAP_PayStatus_fail 支付失败时才会传入,其他状态传""即可。

 

8.自定义事件首次事件

CustomAttributes 类参数说明:

参数名称 参数含义 参数类型 是否必传
eventName
自定义事件名称 string
customProperties
自定义事件属性 Object
preProperties
自定义事件预置属性,目前只支持
_pay_amount与_currency_type,其他字段会被SDK舍弃
Object

 

调用示例

let firstCheckId = "my first check id";

SolarEngine.trackFirstEvent(firstCheckId,attribute);
 

注:如果要上报自定义事件首次事件,那么eventName字段为必传字段,否则无法上报。

最近修改: 2024-11-12Powered by