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

StringYes
eventAttribute
First-time event attributesSERegisterEventAttribute|
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 registration eventSERegisterEventAttribute

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

2.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";
let attribute:CustomAttributes = { 
place_your_key_here: place_your_relative_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 field "eventName" is required, otherwise, the custom first-time event cannot be reported.

Previous
Duration Events
Next
Set User Property
Last modified: 2025-09-22Powered by