菜单

首次事件

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

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

方法示例

public synchronized void trackFirstEvent(SEBaseFirstEventModel seBaseFirstEventModel);

参数说明

参数名称 参数含义 参数类型 是否必传
seBaseFirstEventModel 首次事件类 SEBaseFirstEventModel 是

seBaseFirstEventModel参数使用时需要传SEBaseFirstEventModel的子类实例,具体说明如下:

首次事件 参数类型 说明
自定义首次事件 SECustomFirstEventModel 自定义事件首次事件model类,具体使用方式参考下方示例
变现广告展示首次事件 SEAppImpFirstEventModel 变现广告展示事件首次事件model类,具体使用方式参考下方示例
变现广告点击首次事件 SEAdClickFirstEventModel 变现广告点击事件首次事件model类,具体使用方式参考下方示例
应用内购买首次事件 SEAppPurFirstEventModel 应用内购买事件首次事件model类,具体使用方式参考下方示例
自归因安装首次事件 SEAppAttrFirstEventModel 自归因事件首次事件model类,具体使用方式参考下方示例
订单事件首次事件 SEAppOrderFirstEventModel 订单事件首次事件model类,具体使用方式参考下方示例
注册事件首次事件 SEAppRegisterFirstEventModel 注册事件首次事件model类,具体使用方式参考下方示例
登录事件首次事件 SEAppLoginFirstEventModel 登录事件首次事件model类,具体使用方式参考下方示例

 

调用示例

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

参数说明:

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

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
adNetworkPlatform 变现平台,前面为应传值,后面为平台名称, 例如:变现平台为快手时,只需要传入 kuaishou 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 是
mediationPlatform 填充广告的聚合平台,变现广告由聚合平台填充时必填,其他情况默认填custom即可 String 是
adType 展示广告的类型,枚举值如下: 例如:adType 为激励视频时,只需要传入 1 1:激励视频 2:开屏 3:插屏 4:全屏视频 5:Banner 6:信息流 7:短视频信息流 8:大横幅 9:视频贴片 10:中等尺寸横幅 0:其它 int 是
adNetworkAppID 变现平台的应用 ID String 否
adNetworkADID 变现平台的变现广告位 ID String 是
ecpm 广告 ecpm,单位:元(广告千次展现的变现收入,0或负值表示没传,单位为元) float 是
currencyType 展示收益的货币种类,遵循《ISO 4217国际标准》,如 CNY、USD String 是
isRenderSuccess 广告是否渲染成功,具体枚举值如下: 例如:成功时,只需要传入 true true:成功 false:失败 如果不需要统计该指标,请传 true boolean 是
customProperties 开发者传入的自定义属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
 
SEAppImpFirstEventModel seAppImpFirstEventModel = new SEAppImpFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报
seAppImpFirstEventModel.setCheckId("11aaBB");        
seAppImpFirstEventModel.setAdNetworkPlatform("kuaishou");
seAppImpFirstEventModel.setMediationPlatform("Mintgaral");
seAppImpFirstEventModel.setAdType(1);
seAppImpFirstEventModel.setAdNetworkAppID("广告AppID");
seAppImpFirstEventModel.setAdNetworkADID("广告ID");
seAppImpFirstEventModel.setEcpm(10.11);
seAppImpFirstEventModel.setCurrencyType("USD");
seAppImpFirstEventModel.setRenderSuccess(true);
JSONObject customProperties = new JSONObject();
try {
     //开发者自定义Json格式上报事件属性
     customProperties.put("key1","value1");
     customProperties.put("key2","value2");
     seAppImpFirstEventModel.setCustomProperties(customProperties);
} catch (JSONException e) {
    ///
}
SolarEngineManager.getInstance().trackFirstEvent(seAppImpFirstEventModel);
 

 

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

参数说明:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
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 是
mediationPlatform 填充广告的聚合平台,变现广告由聚合平台填充时必填,其他情况默认填 custom 即可 String 是
adType 展示广告的类型,枚举值如下(传值传前面的枚举简称即可): 1:激励视频 2:开屏 3:插屏 4:全屏视频 5:Banner 6:信息流 7:短视频信息流 8:大横幅 9:视频贴片 0:其它 int 是
adNetworkADID 变现平台的变现广告位 ID String 是
customProperties 开发者传入的自定义属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
 
SEAdClickFirstEventModel seClickFirstEventModel = new SEAdClickFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报 
seClickFirstEventModel.setCheckId("22bbCC");
seClickFirstEventModel.setAdPlatform("kuaishou");
seClickFirstEventModel.setMediationPlatform("Mintgaral");
seClickFirstEventModel.setAdType(2);
seClickFirstEventModel.setAdNetworkADID("广告ID");
JSONObject customProperties = new JSONObject();
try {
     /开发者自定义Json格式上报事件属性
     customProperties.put("key1","value1");
     customProperties.put("key2","value2");
     seClickFirstEventModel.setCustomProperties(customProperties);
} catch (JSONException e) {
     ///
}
SolarEngineManager.getInstance().trackFirstEvent(seClickFirstEventModel);
 

 

3.自归因事件首次事件

参数说明:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
adNetwork 投放广告的渠道 ID,需要与ROI分析匹配 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 开发者传入的自定义属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
 
SEAppAttrFirstEventModel seAppAttrFirstEventModel = new SEAppAttrFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报 
seAppAttrFirstEventModel.setCheckId("33ccDD");
seAppAttrFirstEventModel.setAdNetwork("投放广告的渠道ID");
seAppAttrFirstEventModel.setSubChannel("投放广告的子渠道");
seAppAttrFirstEventModel.setAdAccountId("投放广告的投放账号ID");
seAppAttrFirstEventModel.setAdAccountName("投放广告的投放账号名称");
seAppAttrFirstEventModel.setAdCampaignId("投放广告的广告计划ID");
seAppAttrFirstEventModel.setAdCampaignName("投放广告的广告计划名称");
seAppAttrFirstEventModel.setAdOfferId("投放广告的广告单元ID");
seAppAttrFirstEventModel.setAdOfferName("投放广告的广告单元名称");
seAppAttrFirstEventModel.setAdCreativeId("投放广告的广告创意ID");
seAppAttrFirstEventModel.setAdCreativeName("投放广告的广告创意名称");
seAppAttrFirstEventModel.setAttributionPlatform("监测平台");
JSONObject customProperties = new JSONObject();
try {
     /开发者自定义Json格式上报事件属性
     customProperties.put("key1","value1");
     customProperties.put("key2","value2");
     seAppAttrFirstEventModel.setCustomProperties(customProperties);
} catch (JSONException e) {
     ///
}
SolarEngineManager.getInstance().trackFirstEvent(seAppAttrFirstEventModel);
 

 

4.登录事件首次事件

参数说明:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
loginType 登录类型如 WeChat、QQ 等自定义值 String 是
status 登录状态 String 否
customProperties 开发者传入的自定义属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
 
SEAppLoginFirstEventModel seAppLoginFirstEventModel = new SEAppLoginFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报 
seAppLoginFirstEventModel.setCheckId("44ddEE");
seAppLoginFirstEventModel.setLoginType("QQ");
seAppLoginFirstEventModel.setStatus("success");

JSONObject customProperties = new JSONObject();
try {
     /开发者自定义Json格式上报事件属性
     customProperties.put("key1","value1");
     customProperties.put("key2","value2");
     seAppLoginFirstEventModel.setCustomProperties(customProperties);
} catch (JSONException e) {
     ///
}
SolarEngineManager.getInstance().trackFirstEvent(seAppLoginFirstEventModel);
 

 

5.注册事件首次事件

参数说明:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
regType 注册类型如 WeChat、QQ 等自定义值 String 是
status 注册状态 String 否
customProperties 开发者传入的自定义属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
 
SEAppRegisterFirstEventModel seAppRegisterFirstEventModel = new SEAppRegisterFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报 
seAppRegisterFirstEventModel.setCheckId("55eeFF");
seAppRegisterFirstEventModel.setRegType("Wechat");
seAppRegisterFirstEventModel.setStatus("success");
JSONObject customProperties = new JSONObject();
try {
    //开发者自定义Json格式上报事件属性
    customProperties.put("key1","value1");
    customProperties.put("key2","value2");
    seAppRegisterFirstEventModel.setCustomProperties(customProperties);
} catch (JSONException e) {
    ///
}
SolarEngineManager.getInstance().trackFirstEvent(seAppRegisterFirstEventModel);

 

6.订单事件首次事件

参数说明:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
orderId 订单 ID String 否
payAmount 订单金额,单位:元 double 是
currencyType 支付的货币类型,遵循《ISO 4217国际标准》,如 CNY、USD String 是
payType 支付方式:如 alipay、weixin、applepay、paypal 等 String 是
status 订单状态 String 否
customProperties 开发者传入的自定义属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
 
SEAppOrderFirstEventModel seAppOrderFirstEventModel = new SEAppOrderFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报 
seAppOrderFirstEventModel.setCheckId("66ffGG");
seAppOrderFirstEventModel.setOrderId("本次购买由系统生成的订单ID");
seAppOrderFirstEventModel.setPayAmount(10.11);
seAppOrderFirstEventModel.setCurrencyType("USD");
seAppOrderFirstEventModel.setPayType("alipay");
seAppOrderFirstEventModel.setStatus("success");
JSONObject customProperties = new JSONObject();
try {
    //开发者自定义Json格式上报事件属性
    customProperties.put("key1","value1");
    customProperties.put("key2","value2");
    seAppOrderFirstEventModel.setCustomProperties(customProperties);
} catch (JSONException e) {
    ///
}
SolarEngineManager.getInstance().trackFirstEvent(seAppOrderFirstEventModel);
 

 

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

参数说明:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
orderId 本次购买由系统生成的订单 ID String 否
payAmount 本次购买支付的金额,单位:元 double 是
currencyType 支付的货币类型,遵循《ISO 4217国际标准》,如 CNY、USD String 是
payType 支付方式:如 alipay、weixin、applepay、paypal 等 String 否
productId 购买商品的ID String 否
productName 商品名称 String 否
productNum 购买商品的数量 int 否
payStatus 支付状态,例如:成功时,只需要传入 1 1:成功 2:失败 int 是
failReason 支付失败的原因 String 否
customProperties 开发者传入的自定义属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;
 
SEAppPurFirstEventModel seAppPurFirstEventModel = new SEAppPurFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报 
seAppPurFirstEventModel.setCheckId("77ggHH");
seAppPurFirstEventModel.setOrderId("本次购买由系统生成的订单ID");
seAppPurFirstEventModel.setPayAmount(11.01);
seAppPurFirstEventModel.setCurrencyType("CNY");
seAppPurFirstEventModel.setPayType("alipay");
seAppPurFirstEventModel.setProductId("购买商品的ID");
seAppPurFirstEventModel.setProductName("Nike");
seAppPurFirstEventModel.setProductNum(10);
seAppPurFirstEventModel.setPayStatus(2);
seAppPurFirstEventModel.setFailReason("failed");
JSONObject customProperties = new JSONObject();
try {
    //开发者自定义Json格式上报事件属性
    customProperties.put("key1","value1");
    customProperties.put("key2","value2");
    seAppPurFirstEventModel.setCustomProperties(customProperties);
} catch (JSONException e) {
    ///
}
SolarEngineManager.getInstance().trackFirstEvent(seAppPurFirstEventModel);
 

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

 

8.自定义事件首次事件

参数说明:

参数名称 参数含义 参数类型 是否必传
checkId 首次事件校验id String 是(如果未传checkId,则为普通事件)
eventName 开发者自定义事件名称 String 是
preEventData
自定义事件预置属性,目前只支持
_pay_amount与_currency_type,其他字段会被SDK舍弃
JSONObject 否
customProperties 开发者自定义事件属性 JSONObject 否

调用示例

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;

SECustomFirstEventModel seCustomFirstEventModel = new SECustomFirstEventModel();
//如果不传checkId则当前事件会被当成正常事件上报,若传checkId则首次事件只会被调用一次,不会重复上报 
seCustomFirstEventModel.setCheckId("88hhII");
//如果要上报自定义事件首次事件,那么eventName字段为必传字段,否则无法上报
seCustomFirstEventModel.setEventName("custom_event");
JSONObject customProperties = new JSONObject();
JSONObject preEventData = new JSONObject();
try {
    //开发者自定义Json格式上报事件属性
    customProperties.put("key1","value1");
    customProperties.put("key2","value2");
    seCustomFirstEventModel.setCustomProperties(customProperties);
    //设置预置属性,目前只支持_pay_amount与_currency_type,其他字段会被SDK舍弃
    preEventData.put("_pay_amount", 11.2);
    preEventData.put("_currency_type", "USD");
    seCustomFirstEventModel.setPreEventData(preEventData);
} catch (JSONException e) {
    ///
}
SolarEngineManager.getInstance().trackFirstEvent(seCustomFirstEventModel);
 

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

最近修改: 2025-02-06Powered by