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.
Method example:
public static void trackFirstEvent(SEBaseAttributes attributes);
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
attributes | First-time event attributes | SEBaseAttributes | 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 | Description |
---|---|---|
Custom first-time event | CustomAttributes | Custom first-time event (model type) |
First in-app ad impression event | AppImpressionAttributes | First in-app ad impression event (model type) |
First in-app ad click event | AdClickAttributes | First in-app ad click event (model type) |
First in-app purchase event | ProductsAttributes | First in-app purchase event (model type) |
First self-reported attribution event | AppAttributes | First self-reported attribution event (model type) |
First order event | OrderAttributes | First order event (model type) |
First registration event | RegisterAttributes | First registration event (model type) |
First login event | LoginAttributes | First login event (model type) |
Parameter description:
(For the corresponding fields from each mediation platform, please refer to Mediation Platform-Others)
AppImpressionAttributes parameters:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | string | yes |
ad_platform | Monetization platform (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 |
ad_type | 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 | Int | yes |
ad_appid | The App ID on monetization platforms. | String | no |
ad_id | The Placement ID on monetization platforms. | String | yes |
mediation_platform | Mediation platforms. Record "custom" if no mediation platform is used. | String | yes |
ad_ecpm | Advertising eCPM (0 or negative values are invoid.) (Mininum Unit: USD dollar) | Double | yes |
currency_type | Revenue Currency Type (following ISO 4217) | String | yes |
is_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 | JSONObject | no |
Call example:
AppImpressionAttributes impressionAttributes = new AppImpressionAttributes();
impressionAttributes.ad_platform = "AdMob";
impressionAttributes.ad_appid = "ad_appid";
impressionAttributes.ad_id = "ad_id";
impressionAttributes.ad_type = 1;
impressionAttributes.ad_ecpm = 0.8;
impressionAttributes.currency_type = "USD";
impressionAttributes.is_rendered = true;
impressionAttributes..checkId = "checkId"
Dictionary properties = new Dictionary();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
impressionAttributes.customProperties = properties;
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
SolarEngine.Analytics.trackFirstEvent(impressionAttributes);
AdClickAttributes parameters:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | string | yes |
ad_platform | 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 |
ad_type | 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 | Int | yes |
ad_id | The Placement ID on monetization platforms. | String | yes |
mediation_platform | Mediation platforms. Record "custom" if no mediation platform is used. | String | yes |
customProperties | Custom properties | JSONObject | no |
Call example:
AdClickAttributes AdClickAttributes = new AdClickAttributes();
AdClickAttributes.ad_platform = "admob"; // Monetization Platform
AdClickAttributes.mediation_platform = "gromore";// Mediation Platform proving the ad
AdClickAttributes.ad_id = "943508343"; // Monetization Platform ad placement ID
AdClickAttributes.ad_type = 1; // ad_type
AdClickAttributes.checkId = "checkId";
Dictionary properties = new Dictionary();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
AdClickAttributes.customProperties = properties;
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
SolarEngine.Analytics.trackFirstEvent(AdClickAttributes);
AppAttributes parameters:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | String | yes |
ad_network | Channel ID (should match the channel ID on advertising platform) | String | yes |
sub_channel | Sub-channels for advertising | String | no |
ad_account_id | Ad account ID for advertising | String | no |
ad_account_name | Ad account name for advertising | String | no |
ad_campaign_id | Ad campaign ID for advertising | String | no |
ad_campaign_name | Ad campaign name for advertising | String | no |
ad_offer_id | Ad offer ID for advertising | String | no |
ad_offer_name | Ad offer name for advertising | String | no |
ad_creative_id | Ad creative ID for advertising | String | no |
ad_creative_name | Ad creative name for advertising | String | no |
attribution_platform | Monitoring Platform | String | yes |
customProperties | Custom Properties | Dictionary | no |
Call example:
AppAttributes AppAttributes = new AppAttributes();
AppAttributes.ad_network = "toutiao";
AppAttributes.sub_channel = "103300";
AppAttributes.ad_account_id = "1655958321988611";
AppAttributes.ad_account_name = "xxxGameStudio18";
AppAttributes.ad_campaign_id = "1680711982033293";
AppAttributes.ad_campaign_name = "GoGoGoCampaign157-1024";
AppAttributes.ad_offer_id = "1685219082855528";
AppAttributes.ad_offer_name = "GoGoGoOffer406-1024";
AppAttributes.ad_creative_id = "1680128668901378";
AppAttributes.ad_creative_name = "AutoCreated20210901178921";
AppAttributes.attribution_platform = "Attribution Platformxxx";
AppAttributes AppAttributes = new AppAttributes();
AppAttributes.ad_network = "toutiao";
AppAttributes.sub_channel = "103300";
AppAttributes.ad_account_id = "1655958321988611";
AppAttributes.ad_account_name = "xxxGameStudio18";
AppAttributes.ad_campaign_id = "1680711982033293";
AppAttributes.ad_campaign_name = "GoGoGoCampaign157-1024";
AppAttributes.ad_offer_id = "1685219082855528";
AppAttributes.ad_offer_name = "GoGoGoOffer406-1024";
AppAttributes.ad_creative_id = "1680128668901378";
AppAttributes.ad_creative_name = "AutoCreated20210901178921";
AppAttributes.attribution_platform = "Attribution Platformxxx";
AppAttributes.checkId = "checkId";
Dictionary properties = new Dictionary();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
AppAttributes.customProperties = properties;
SolarEngine.Analytics.trackFirstEvent(AppAttributes);
LoginAttributes parameters:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | String | Yes |
login_type | Login type such as "WeChat", "QQ" and other custom values | String | Yes(No more than 32 characters) |
login_status | Login status such as "success" | String | No |
customProperties | Custom Properties | Dictionary | No |
Call example:
LoginAttributes LoginAttributes = new LoginAttributes();
LoginAttributes.login_type = "QQ";
LoginAttributes.login_status = "success";
LoginAttributes.checkId = "checkId";
Dictionary properties = new Dictionary();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
LoginAttributes.customProperties = properties;
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
SolarEngine.Analytics.trackFirstEvent(LoginAttributes);
RegisterAttributes parameters:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | String | Yes(If checkId is not passed, it will be an ordinary event) |
register_type | Login type such as "WeChat", "QQ" and other custom values | String | Yes(No more than 32 characters) |
register_status | Login status such as "success" | String | No |
customProperties | Custom Properties | Dictionary | No |
Call example:
RegisterAttributes RegisterAttributes = new RegisterAttributes();
RegisterAttributes.register_type = "QQ";
RegisterAttributes.register_status = "success";
RegisterAttributes.checkId = "checkId";
Dictionary properties = new Dictionary();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
RegisterAttributes.customProperties = properties;
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
SolarEngine.Analytics.trackFirstEvent(RegisterAttributes);
OrderAttributes parameters:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | String | Yes(If checkId is not passed, it will be an ordinary event) |
order_id | Order ID | String | No(No more than 32 characters) |
pay_amount | Pay amount, (Mininum Unit: USD dollar) | Double | Yes |
currency_type | Display currency type, following the "ISO 4217 international standard," such as CNY, USD. | String | Yes |
pay_type | Payment method: alipay, weixin, applepay, paypal, etc | String | No |
status | Order status | String | Yes |
customProperties | Custom Properties(For details, see Contents: 4. Customize attributes) | Dictionary | No |
Call example:
OrderAttributes OrderAttributes = new OrderAttributes();
OrderAttributes.order_id = "2341242342676398724"; // Not exceeding 128 characters
OrderAttributes.pay_amount = 128.00; // (Mininum Unit: USD dollar)
OrderAttributes.currency_type = "USD"; // Currency type, following the "ISO 4217 International Standard"
OrderAttributes.pay_type = "Alipay"; // Payment method
OrderAttributes.status = "success";// Order status
OrderAttributes.checkId = "checkId";
Dictionary properties = new Dictionary();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
OrderAttributes.customProperties = properties;
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
SolarEngine.Analytics.trackFirstEvent(OrderAttributes);
ProductsAttributes parameters:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | string | Yes(If checkId is not passed, it will be an ordinary event) |
order_id | The order ID generated by the system for this purchase | string | No |
pay_amount | Payment amount, (Mininum Unit: USD dollar) | double | Yes |
currency_type | The currency type of payment, following the "ISO 4217 international standard," such as CNY, USD. | string | Yes |
pay_type | Payment method: alipay, weixin, applepay, paypal, etc | string | No |
product_id | The ID of the product purchased | string | No |
product_name | Product Name | string | No |
product_num | 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 | SEConstant_IAP_PayStatus | Yes |
fail_reason | Reasons for payment failure | string | No |
customProperties | Custom Properties | Dictionary | No |
Call example:
ProductsAttributes productsAttributes = new ProductsAttributes();
productsAttributes.product_name = "product_name";
productsAttributes.product_id = "product_id";
productsAttributes.product_num = 8;
productsAttributes.currency_type = "USD";
productsAttributes.order_id = "order_id";
productsAttributes.fail_reason = "fail_reason";
productsAttributes.paystatus = 1; // 1 meaning success, 2 meaning failed
productsAttributes.pay_type = "wechat";
productsAttributes.pay_amount = 9.9;
productsAttributes.checkId = "checkId";
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
productsAttributes.customProperties = properties;
// You can choose not to set customProperties.
// Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.
SolarEngine.Analytics.trackFirstEvent(productsAttributes);
CustomAttributes Properties
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
checkId | First-time event verification ID | string | Yes(If checkId is not passed, it will be an ordinary event) |
custom_event_name | Custom event name | string | Yes |
customProperties | Custom event property | Dictionary | Yes |
Call example:
CustomAttributes customAttributes = new CustomAttributes();
customAttributes.checkId = "kkkkllosd";
customAttributes.custom_event_name = "test";
//Set custom event properties
Dictionary<string, object> customProperties = new Dictionary<string, object>();
customProperties.Add("K1", "V1");
customProperties.Add("K2", "V2");
customProperties.Add("K3", 2);
customAttributes.customProperties = customProperties;
//Set custom first-time event preset properties; currently, only _pay_amount and _currency_type are supported, other fields will be discarded by the SDK.
Dictionary<string, object> preProperties = new Dictionary<string, object>();
preProperties.Add("_pay_amount", 11.09);
preProperties.Add("_currency_type", "USD");
customAttributes.preProperties = preProperties;
SolarEngine.Analytics.trackFirstEvent(customAttributes);
Note:
The field "eventName" is required, otherwise, the custom first-time event cannot be reported.