A first-time event refers to an event that is recorded only once for a specific dimension. For example, registration can be recorded using a first-time event. The server will deduplicate based on the ID set by setCheckId(). Only the first event reported with the same ID will be recorded.
Predefined events (_appInstall, _appStart, _appEnd) cannot be set as first-time events.
Function
export function trackFirstEvent(firstCheckId:string,eventAttribute:
SEIAPEventAttribute|
SEAppAttrEventAttribute|
SEOrderEventAttribute|
SERegisterEventAttribute|
SELoginEventAttribute|
SEAdImpressionEventAttribute|
SEAdClickEventAttribute|
SECustomEventAttribute);
Parameter | Description | Type | Required |
---|---|---|---|
firstCheckId | First event verification ID | String | Yes |
eventAttribute | First-time event attributes | SEIAPEventAttribute| SEAppAttrEventAttribute| SEOrderEventAttribute| SERegisterEventAttribute| SELoginEventAttribute| SEAdImpressionEventAttribute| SEAdClickEventAttribute SECustomEventAttribute | Yes |
When using the attributes parameter, you need to pass a subclass instance of it. The specific instructions are as follows.
First-time Event | Parameter Type |
---|---|
Custom first-time event | SECustomEventAttribute |
First in-app ad impression event | SEAdImpressionEventAttribute |
First in-app ad click event | SEAdClickEventAttribute |
First in-app purchase event | SEIAPEventAttribute |
First self-reported attribution event | SEAppAttrEventAttribute |
First order event | SEOrderEventAttribute |
First registration event | SERegisterEventAttribute |
First login event | SELoginEventAttribute |
Parameter description:
(For the corresponding fields from each mediation platform, please refer to Impression-level-revenue-integration )
SEAdImpressionEventAttribute parameters:
Parameter | Description | Type | Required |
---|---|---|---|
adNetworkPlatform | Monetization network (Value: platform name) csj: 穿山甲 China Mainland version pangle: 穿山甲 International version 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 | yes |
adType | Ad types: 1:Rewarded Video Ads 2:Splash Ads 3:Interstitial Ads 4:Full Screen Videos 5:Banner Ads 6:In-Feed Ads 7:Native Video Ads 8:Playable Ads 9:Pre-movie Ads 0:Other | Number | yes |
adNetworkAppID | The App ID on monetization platforms. | String | no |
adNetworkPlacementID | The Placement ID on monetization platforms. | String | yes |
mediationPlatform | Mediation platforms as followed. Record "custom" if no mediation platform is used: max ironsource admob hyperbid topon cas Tradplus Tobid | String | yes |
ecpm | Advertising eCPM (0 or negative values are invoid.) (Mininum Unit: e.g. USD, CNY, etc.) | Number | yes |
currency | Revenue Currency Type (following ISO 4217) | String | yes |
rendered | Whether the ad is rendered successfully. YES: success NO: Failed. If you do not need to pass in this indicator, please pass YES. | Boolean | yes |
customProperties | Custom properties, json string | Object | no |
Sample Code
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"}
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
SEAdClickEventAttribute parameters:
Parameter | Description | Type | Required |
---|---|---|---|
adNetworkPlatform | Monetization platforms, for example (value: name), 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 | yes |
adType | Ad types, for example (value: explanation), 1:Rewarded Video Ads 2:Splash Ads 3:Interstitial Ads 4:Full Screen Videos 5:Banner Ads 6:In-Feed Ads 7:Native Video Ads 8:Playable Ads 9:Pre-movie Ads 0:Other | Number | yes |
adNetworkPlacementID | The Placement ID on monetization platforms. | String | yes |
mediationPlatform | Mediation platforms as followed. Record "custom" if no mediation platform is used: max ironsource admob hyperbid topon cas Tradplus Tobid | String | yes |
customProperties | Custom properties | Object | no |
Sample Code
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"}
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
SEAppAttrEventAttribute parameters:
Parameter | Description | Type | Required |
---|---|---|---|
checkId | First-time event verification ID | String | yes |
adNetwork | Channel ID (should match the channel ID on advertising platform) | String | yes |
subChannel | Sub-channels for advertising | String | no |
adAccountID | Ad account ID for advertising | String | no |
adAccountName | Ad account name for advertising | String | no |
adCampaignID | Ad campaign ID for advertising | String | no |
adCampaignName | Ad campaign name for advertising | String | no |
adOfferID | Ad offer ID for advertising | String | no |
adOfferName | Ad offer name for advertising | String | no |
adCreativeID | Ad creative ID for advertising | String | no |
adCreativeName | Ad creative name for advertising | String | no |
attributionPlatform | Monitoring Platform | String | yes |
customProperties | Custom Properties | Object | no |
Sample Code
let firstCheckId = "my first check id";
let attribute:SEAppAttrEventAttribute = {
adNetwork:"toutiao",
subChannel:"103300", //If no value, please send ""
adAccountID:"1655958321988611",//If no value, please send ""
adAccountName:"xxx科技全量18",//If no value, please send ""
adCampaignID:"1680711982033293",//If no value, please send ""
adCampaignName:"冲冲冲计划157-1024",//If no value, please send ""
adOfferID:"1685219082855528",//If no value, please send ""
adOfferName:"冲冲冲单元406-1024",//If no value, please send ""
adCreativeID:"1680128668901378",//If no value, please send ""
adCreativeName:"自动创建20210901178921",//If no value, please send ""
attributionPlatform:"广告监测平台xxx",
customProperties:{"customProperties":"app attr customProperties value"}
// You can choose not to set customProperties. // Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
SELoginEventAttribute parameters:
Parameter | Description | Type | Required |
---|---|---|---|
loginType | Login type such as "WeChat", "QQ" and other custom values | String | Yes (No more than 32 characters) |
loginStatus | Login status such as "success" | String | No |
customProperties | Custom Properties | Object | No |
Sample Code
let firstCheckId = "my first check id";
let attribute:SELoginEventAttribute = {
loginType:"WeChat",
loginStatus:"failed",
customProperties:{"key":"login customProperties value"}
// You can choose not to set customProperties. // Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
SERegisterEventAttribute parameters:
Parameter | Description | Type | Required |
---|---|---|---|
registerType | Login type such as "WeChat", "QQ" and other custom values | String | Yes (No more than 32 characters) |
registerStatus | Login status such as "success" | String | No |
customProperties | Custom Properties | Object | No |
Sample Code
let firstCheckId = "my first check id";
let attribute:SERegisterEventAttribute = {
registerType:"WeChat",
registerStatus:"success",
customProperties:{"key":"register customProperties value"}
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
SEOrderEventAttribute parameters:
Parameter | Description | Type | Required |
---|---|---|---|
orderID | Order ID | String | No (No more than 32 characters) |
payAmount | Pay amount, (Mininum Unit: USD dollar) | Number | Yes |
currency | Display currency type, following the "ISO 4217 international standard," such as CNY, USD. | String | Yes |
payType | Payment method: alipay, weixin, applepay, paypal, etc | String | No |
status | Order status | String | Yes |
customProperties | Custom Properties(For details, see Contents: 4. Customize attributes) | Object | No |
Sample Code
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"}
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
SEIAPEventAttribute parameters:
Parameter | Description | Type | Required |
---|---|---|---|
orderId | The order ID generated by the system for this purchase | string | No |
payAmount | Payment amount, (Mininum Unit: USD dollar) | number | Yes |
currency | The currency type of payment, following the "ISO 4217 international standard," such as CNY, USD. | string | Yes |
payType | Payment method: alipay, weixin, applepay, paypal, etc | string | No |
productId | The ID of the product purchased | string | No |
productName | Product Name | string | No |
productCount | The quantity of products purchased | Int | No |
payStatus | Payment status SEConstant_IAP_PayStatus enumerates SEConstant_IAP_PayStatus_success: success SEConstant_IAP_PayStatus_fail: failure SEConstant_IAP_PayStatus_restored: The node is restored | SEIAPStatus | Yes |
failReason | Reasons for payment failure | string | No |
customProperties | Custom Properties | Object | No |
Sample Code
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"}
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
}
SolarEngine.trackFirstEvent(firstCheckId,attribute);
Note:
The fail_reason parameter for payment failure will only be passed when the paystatus is SEConstant_IAP_PayStatus_fail. For other statuses, an empty string "" can be passed.
CustomAttributes parameters
Parameter | Description | Type | Required |
---|---|---|---|
eventName | Custom event name | string | Yes |
customProperties | Custom event property | object | Yes |
preProperties | Custom preset event property (_pay_amount and _currency_type only) | object | Yes |
Sample Code
let firstCheckId = "my first check id";
SolarEngine.trackFirstEvent(firstCheckId,attribute);
Note:
The field "eventName" is required, otherwise, the custom first-time event cannot be reported.