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);| Parameter | Description | Type | Required |
|---|---|---|---|
| firstCheckId | First event verification ID | String | Yes |
| eventAttribute | First-time event attributes | SERegisterEventAttribute| 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 registration event | SERegisterEventAttribute |
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);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";
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.