注: iOS/Android的 _event_name为「_appxxx」,小游戏的为「_mpxxx」
注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
变现广告展示事件
App内变现广告展示时,报送该事件,用于进行广告展示及变现收入分析。
使用ROI分析功能、自定义分析变现指标时,为必须报送事件。
广告展示事件的 _event_name 为 _appImp「小游戏为_mpImp」
方法示例
public static void trackAdImpression(ImpressionAttributes attributes)
参数说明
ImpressionAttributes 类参数说明:
参数名称 | 参数含义 | 参数类型 | 是否必传 |
ad_platform | 变现平台,前面为应传值,后面为平台名称 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 | 是 |
ad_type | 展示广告的类型 1:激励视频 2:开屏 3:插屏 4:全屏视频 5:Banner 6:信息流 7:短视频信息流 8:大横幅 9:视频贴片 10:中等尺寸横幅 0:其它 |
int | 是 |
ad_appid | 变现平台的应用 ID | string | 否 |
ad_id | 变现平台的变现广告位 ID | string | 是 |
mediation_platform | 聚合平台标识,常见聚合平台枚举如下,若您使用的聚合平台不在如下枚举值,您可以自定义命名,并控制字符数在32位。没有聚合平台标识,请设置为 "custom"。 max ironsource admob hyperbid topon cas Tradplus Tobid |
string | 是 |
ad_ecpm | 广告ECPM(广告千次展现的变现收入,0或负值表示没传),单位:元 | double | 是 |
currency_type | 展示收益的货币种类,遵循《ISO 4217国际标准》如 CNY、USD | string | 是 |
is_rendered | 广告是否渲染成功,具体枚举值如下: 例如:成功时,只需要传入 YES YES:成功 NO:失败 如果不需要统计该指标,请传 YES |
bool | 是 |
customProperties | 自定义属性, | Dictionary | 否 |
调用示例
ImpressionAttributes impressionAttributes = new ImpressionAttributes();
impressionAttributes.ad_platform = "AdMob";
impressionAttributes.ad_appid = "ad_appid";
impressionAttributes.ad_id = "product_id";
impressionAttributes.ad_type = 1;
impressionAttributes.ad_ecpm = 0.8;
impressionAttributes.currency_type = "CNY";
impressionAttributes.mediation_platform = "MAX"//填入您所使用的聚合平台
impressionAttributes.is_rendered = true;
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
impressionAttributes.customProperties = properties;
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
SolarEngine.Analytics.trackAdImpression(impressionAttributes);
GroMore 聚合 SDK 对接示例:
ImpressionAttributes impressionAttributes = new ImpressionAttributes();
impressionAttributes.ad_platform = ABUBannerAd.GetAdRitInfoAdnName();
impressionAttributes.ad_appid = "ad_appid";
// ad_appid变现平台的应用 ID,有则传没有可以不用传
impressionAttributes.ad_id = ABUBannerAd.GetAdNetworkRitId();
impressionAttributes.ad_type = SEConstant_IAI_AdType.SEConstant_IAI_AdTypeBanner;
impressionAttributes.mediation_platform = "gromore";
double ecpm = Convert.ToDouble(ABUBannerAd.GetPreEcpm());
// SolarEngineSDK ecpm 单价为元,GromoreSDK ecpm单位为分
impressionAttributes.ad_ecpm = ecpm/100.00;
// Gromore的币种请与运营确认是"CNY"还是"USD"
impressionAttributes.currency_type = "CNY";
impressionAttributes.is_rendered = true;
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
impressionAttributes.customProperties = properties;
SolarEngine.Analytics.trackAdImpression(impressionAttributes);
应用内购买事件
App 内付费购买时,报送该事件,用于进行购买及内购收入分析。
该事件为用于付费预测模型训练的关键事件,使用系统提供的预测服务时,为必须报送事件。
应用内购买事件的 _event_name 为 _appPur「小游戏为_mpPur」。
方法示例
public static void trackPurchase(ProductsAttributes attributes)
参数说明
ProductsAttributes 类参数说明:
参数名称 | 参数含义 | 参数类型 | 是否必传 |
order_id | 本次购买由系统生成的订单 ID | string | 否,投放荣耀商推、网易有道、豆瓣和oppo时必填 |
pay_amount | 本次购买支付的金额,单位:元 | double | 是 |
currency_type | 支付的货币类型,遵循《ISO 4217国际标准》,如 CNY、USD | string | 是 |
pay_type | 支付方式:如 alipay、weixin、applepay、paypal 等 | string | 否 |
product_id | 购买商品的ID | string | 否 |
product_name | 商品名称 | string | 否 |
product_num | 购买商品的数量 | Int | 否 |
paystatus | 支付状态 Success:成功 Fail:失败 Restored:恢复 |
PayStatus | 是 |
fail_reason | 支付失败的原因 | string | 否 |
customProperties | 自定义属性 | Dictionary | 否 |
注:支付失败原因 fail_reason 参数仅在 PayStatus参数为 fail 支付失败时才会传入,其他状态传""即可。
调用示例
ProductsAttributes productsAttributes = new ProductsAttributes();
productsAttributes.product_name = "product_name";
productsAttributes.product_id = "product_id";
productsAttributes.product_num = 8;
productsAttributes.currency_type = "CNY";
productsAttributes.order_id = "order_id";
productsAttributes.fail_reason = "fail_reason";
productsAttributes.paystatus = PayStatus.Success;
productsAttributes.pay_type = "wechat";
productsAttributes.pay_amount = 9.9;
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
productsAttributes.customProperties = properties;
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
SolarEngine.Analytics.trackPurchase(productsAttributes);
上报变现广告点击事件
调用 trackAdClick 方法可以上报变现广告点击事件,_event_name 为 _appClick「小游戏为_mpClick」
方法示例
public static void trackAdClick(AdClickAttributes attributes)
AdClickAttributes 类参数说明:
参数名称 | 参数含义 | 参数类型 | 是否必传 |
ad_platform | 变现平台,前面为应传值,后面为平台名称 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 | 是 |
ad_type | 展示广告的类型 1:激励视频 2:开屏 3:插屏 4:全屏视频 5:Banner 6:信息流 7:短视频信息流 8:大横幅 9:视频贴片 0:其它 |
int | 是 |
ad_id | 变现平台的变现广告位 ID | string | 是 |
mediation_platform | 聚合平台标识,常见聚合平台枚举如下,若您使用的聚合平台不在如下枚举值,您可以自定义命名,并控制字符数在32位。没有聚合平台标识,请设置为 "custom"。 max ironsource admob hyperbid topon cas Tradplus Tobid |
string | 是 |
customProperties | 自定义属性说明见目录:4.自定义属性 | Dictionary | 否 |
调用示例
AdClickAttributes AdClickAttributes = new AdClickAttributes();
AdClickAttributes.ad_platform = "admob"; // 变现平台 具体描述见:AdClickAttributes类
AdClickAttributes.mediation_platform = "gromore";// 填充广告的聚合平台
AdClickAttributes.ad_id = "943508343"; // 变现平台的变现广告位 ID
AdClickAttributes.ad_type = 1; // ad_type具体描述见:AdClickAttributes类
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
AdClickAttributes.customProperties = properties;
// customProperties 为自定义属性,可以为空
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
SolarEngine.Analytics.trackAdClick(AdClickAttributes);
上报注册事件
调用 trackRegister 方法可以上报注册事件,_event_name 为 _appReg「小游戏为_mpReg」
方法示例
public static void trackRegister(RegisterAttributes attributes)
RegisterAttributes 类参数介绍:
参数名称 | 参数含义 | 参数类型 | 是否必传 |
register_type | 注册类型如 "WeChat"、"QQ" 等自定义值 | string | 是,不超过 32 字符 |
register_status | 注册状态 如 "success" | string | 否 |
customProperties | 自定义属性 | Dictionary | 否 |
调用示例
RegisterAttributes RegisterAttributes = new RegisterAttributes();
RegisterAttributes.register_type = "QQ";
RegisterAttributes.register_status = "success";
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
RegisterAttributes.customProperties = properties;
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
SolarEngine.Analytics.trackRegister(RegisterAttributes);
上报登录事件
调用 trackLogin 方法可以上报登录事件,_event_name 为 _appLogin「小游戏为_mpLogin」
方法示例
public static void trackLogin(LoginAttributes attributes)
LoginAttributes 类参数介绍:
参数名称 | 参数含义 | 参数类型 | 是否必传 |
login_type | 登录类型如 "WeChat"、"QQ" 等自定义值 | string | 是,不超过 32 字符 |
login_status | 登录状态 如 "success" | string | 否 |
customProperties | 自定义属性 | Dictionary | 否 |
调用示例
LoginAttributes LoginAttributes = new LoginAttributes();
LoginAttributes.login_type = "QQ";
LoginAttributes.login_status = "success";
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
LoginAttributes.customProperties = properties;
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
SolarEngine.Analytics.trackLogin(LoginAttributes);
上报订单事件
调用 trackOrder 方法可以上报订单事件,_event_name 为 _appOrder「小游戏为_mpOrder」
方法示例
public static void trackOrder(OrderAttributes attributes)
OrderAttributes 类参数介绍:
参数名称 | 参数含义 | 参数类型 | 是否必传 |
order_id | 订单 ID | string | 否,不超过 128 字符,投放荣耀商推、网易有道、豆瓣和oppo时必填 |
pay_amount | 订单金额,单位:元 | double | 是 |
currency_type | 展示货币类型,遵循《ISO 4217国际标准》,如 CNY、USD | string | 是 |
pay_type | 支付方式:如 alipay、weixin、applepay、paypal 等 | string | 否,不超过 32 字符 |
status | 订单状态 | string | 是 |
customProperties | 自定义属性说明见目录:4.自定义属性 | Dictionary | 否 |
调用示例
OrderAttributes OrderAttributes = new OrderAttributes();
OrderAttributes.order_id = "2341242342676398724"; // 订单ID不超过128字符
OrderAttributes.pay_amount = 128.00; // 单位元
OrderAttributes.currency_type = "CNY"; // 货币类型,遵循《ISO 4217国际标准》
OrderAttributes.pay_type = "Alipay"; // 支付方式
OrderAttributes.status = "success"; // 订单状态
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
OrderAttributes.customProperties = properties;
// customProperties 为自定义属性,可以不设置
// 注:开发者传入属性 key 不能为"_"下划线开头,"_"下划线开头为SDK保留字段,开发者设置则直接报错丢弃
SolarEngine.Analytics.trackOrder(OrderAttributes)
上报自归因事件
增加归因安装事件,支持统计归因数据,满足客户使用三方归因或者自归因之后的结果数据回传到自定义分析,上报时机支持开发者自定义触发
自归因事件的 `_event_name` 为 _appAttr「小游戏为_mpAttr」。
方法示例
public static void trackAttribution(Attributes attributes)
参数说明
参数名称 | 参数含义 | 参数类型 | 是否必传 |
ad_network | 投放广告的渠道 ID,需要与发行平台匹配 | string | 是 |
sub_channel | 投放广告的子渠道 | string | 否 |
ad_account_id | 投放广告的投放账号 ID | string | 否 |
ad_account_name | 投放广告的投放账号名称 | string | 否 |
ad_campaign_id | 投放广告的广告计划 ID | string | 否 |
ad_campaign_name | 投放广告的广告计划名称 | string | 否 |
ad_offer_id | 投放广告的广告单元 ID | string | 否 |
ad_offer_name | 投放广告的广告单元名称 | string | 否 |
ad_creative_id | 投放广告的广告创意 ID | string | 否 |
ad_creative_name | 投放广告的广告创意名称 | string | 否 |
attribution_platform | 监测平台 | string | 是 |
customProperties | 开发者传入的自定义属性 | Dictionary | 否 |
调用示例
AttAttributes attAttributes = new AttAttributes();
attAttributes.ad_network = "toutiao";
attAttributes.sub_channel = "103300";
attAttributes.ad_account_id = "1655958321988611";
attAttributes.ad_account_name = "xxx科技全量18";
attAttributes.ad_campaign_id = "1680711982033293";
attAttributes.ad_campaign_name = "小鸭快冲计划157-1024";
attAttributes.ad_offer_id = "1685219082855528";
attAttributes.ad_offer_name = "小鸭快冲单元406-1024";
attAttributes.ad_creative_id = "1680128668901378";
attAttributes.ad_creative_name = "自动创建20210901178921";
attAttributes.ad_creative_name = "自动创建20210901178921";
attAttributes.attribution_platform = "se";
Dictionary<string, object> properties = new Dictionary<string, object>();
properties.Add("K1", "V1");
properties.Add("K2", "V2");
properties.Add("K3", 2);
attAttributes.customProperties = properties;
SolarEngine.Analytics.trackAttribution(attAttributes);