Menu

First-Time Event

      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);
ParameterDescriptionTypeRequired
firstCheckId First event verification ID

StringYes
eventAttribute
First-time event attributesSEIAPEventAttribute|
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 EventParameter Type
Custom first-time eventSECustomEventAttribute
First in-app ad impression eventSEAdImpressionEventAttribute
First in-app ad click eventSEAdClickEventAttribute
First in-app purchase eventSEIAPEventAttribute
First self-reported attribution eventSEAppAttrEventAttribute
First order eventSEOrderEventAttribute
First registration eventSERegisterEventAttribute
First login eventSELoginEventAttribute

1. First in-app ad impression event

Parameter description:

       (For the corresponding fields from each mediation platform, please refer to Impression-level-revenue-integration )

SEAdImpressionEventAttribute parameters:

ParameterDescriptionTypeRequired
adNetworkPlatformMonetization 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
Stringyes
adTypeAd 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
Numberyes
adNetworkAppIDThe App ID on monetization platforms.Stringno
adNetworkPlacementIDThe Placement ID on monetization platforms.Stringyes
mediationPlatformMediation platforms as followed. Record "custom" if no mediation platform is used:
max
ironsource
admob
hyperbid
topon
cas
Tradplus
Tobid
Stringyes
ecpmAdvertising eCPM
(0 or negative values are invoid.)
(Mininum Unit: e.g. USD, CNY, etc.)
Numberyes
currencyRevenue Currency Type (following ISO 4217)Stringyes
renderedWhether the ad is rendered successfully.
YES: success
NO: Failed.
If you do not need to pass in this indicator, please pass YES.
Booleanyes
customPropertiesCustom properties, json stringObjectno

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);

2. First in-app ad click event

SEAdClickEventAttribute parameters:

ParameterDescriptionTypeRequired
adNetworkPlatformMonetization 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
Stringyes
adTypeAd 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
Numberyes
adNetworkPlacementIDThe Placement ID on monetization platforms.Stringyes
mediationPlatformMediation platforms as followed. Record "custom" if no mediation platform is used:
max
ironsource
admob
hyperbid
topon
cas
Tradplus
Tobid
Stringyes
customPropertiesCustom propertiesObjectno

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);

3. First self-reported attribution event

SEAppAttrEventAttribute parameters:

ParameterDescriptionTypeRequired
checkIdFirst-time event verification IDStringyes
adNetworkChannel ID (should match the channel ID on advertising platform)Stringyes
subChannelSub-channels for advertisingStringno
adAccountIDAd account ID for advertisingStringno
adAccountNameAd account name for advertisingStringno
adCampaignIDAd campaign ID for advertisingStringno
adCampaignNameAd campaign name for advertisingStringno
adOfferIDAd offer ID for advertisingStringno
adOfferNameAd offer name for advertisingStringno
adCreativeIDAd creative ID for advertisingStringno
adCreativeNameAd creative name for advertisingStringno
attributionPlatformMonitoring PlatformStringyes
customPropertiesCustom PropertiesObjectno

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);

4. First login event

SELoginEventAttribute parameters:

ParameterDescriptionTypeRequired
loginTypeLogin type such as "WeChat", "QQ" and other custom valuesStringYes
(No more than 32 characters)
loginStatus Login status such as "success"StringNo
customPropertiesCustom Properties ObjectNo

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);

5. First registration event

SERegisterEventAttribute parameters:

ParameterDescriptionTypeRequired
registerTypeLogin type such as "WeChat", "QQ" and other custom valuesStringYes
(No more than 32 characters)
registerStatusLogin status such as "success"StringNo
customPropertiesCustom PropertiesObjectNo

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);

6. First order event

SEOrderEventAttribute parameters:

Parameter DescriptionType Required
orderIDOrder IDStringNo (No more than 32 characters)
payAmountPay amount, (Mininum Unit: USD dollar)NumberYes
currencyDisplay currency type, following the "ISO 4217 international standard," such as CNY, USD.StringYes
payTypePayment method: alipay, weixin, applepay, paypal, etcStringNo
statusOrder statusStringYes
customPropertiesCustom Properties(For details, see Contents: 4. Customize attributes)ObjectNo

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);

7. First in-app purchase event

SEIAPEventAttribute parameters:

ParameterDescriptionType Required
orderIdThe order ID generated by the system for this purchasestringNo
payAmountPayment amount, (Mininum Unit: USD dollar)numberYes
currencyThe currency type of payment, following the "ISO 4217 international standard," such as CNY, USD.stringYes
payTypePayment method: alipay, weixin, applepay, paypal, etcstringNo
productIdThe ID of the product purchased

stringNo
productNameProduct NamestringNo
productCountThe quantity of products purchased

IntNo
payStatusPayment status SEConstant_IAP_PayStatus enumerates SEConstant_IAP_PayStatus_success: success SEConstant_IAP_PayStatus_fail: failure SEConstant_IAP_PayStatus_restored: The node is restoredSEIAPStatusYes
failReasonReasons for payment failurestringNo
customPropertiesCustom PropertiesObjectNo

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.

8. Custom first-time event

CustomAttributes parameters

ParameterDescription TypeRequired
eventNameCustom event namestringYes
customPropertiesCustom event propertyobjectYes
prePropertiesCustom preset event property
(_pay_amount and _currency_type only)
objectYes

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.

Previous
Duration Events
Next
Set User Property
Last modified: 2024-12-05Powered by