智能客服
你问我答,随时在线为你解决问题
HMS Core
关于华为分析服务即将日落的通知
尊敬的开发者,您好!
感谢您一直以来对我们的支持与陪伴。很遗憾地通知您,我们的平台即将步入日落的阶段。我们已于2024年6月30日关闭华为分析服务的开通入口,不再支持新用户注册。已开通华为分析服务的项目的开发者,请提前做好数据备份和迁移准备,我们衷心希望您能在新平台上继续享受优质的服务。
根据常用的使用场景,Analytics SDK预先定义了部分事件ID,推荐优先使用预定义常量进行埋点和分析,系统基于预置事件提供了丰富的洞察报告。
预置事件和参数是Analytics Kit的保留字段,自定义事件的事件ID不能与预置事件的ID重复,否则会被识别为预置事件。
预置事件的ID常量请参见HAEventType、参数ID常量请参见HAParamType。
埋点后,您需要到分析控制台去注册预置事件及相关参数,注册方法请参见事件管理。当用户触发相应的事件时,您可在控制台实时概览界面查看可视化分析数据的报告。
如果您的事件ID已在预置事件列表HAEventType中,请参考如下步骤进行埋点:
- import com.huawei.hms.analytics.type.HAEventType;
- import com.huawei.hms.analytics.type.HAParamType;
- import com.huawei.hms.analytics.type.HAEventType
- import com.huawei.hms.analytics.type.HAParamType
- Bundle bundle_pre = new Bundle();
- bundle_pre.putString(HAParamType.PRODUCTID, "item_ID");
- bundle_pre.putString(HAParamType.PRODUCTNAME, "name");
- bundle_pre.putString(HAParamType.CATEGORY, "category");
- bundle_pre.putLong(HAParamType.QUANTITY, 100L);
- bundle_pre.putDouble(HAParamType.PRICE, 10.01);
- bundle_pre.putDouble(HAParamType.REVENUE, 10);
- bundle_pre.putString(HAParamType.CURRNAME, "currency");
- bundle_pre.putString(HAParamType.PLACEID, "location_ID");
- instance.onEvent(HAEventType.ADDPRODUCT2WISHLIST, bundle_pre);
- val bundle_pre = Bundle()
- bundle_pre.putString(HAParamType.PRODUCTID, "item_ID")
- bundle_pre.putString(HAParamType.PRODUCTNAME, "name")
- bundle_pre.putString(HAParamType.CATEGORY, "category")
- bundle_pre.putLong(HAParamType.QUANTITY, 100L)
- bundle_pre.putDouble(HAParamType.PRICE, 10.01)
- bundle_pre.putDouble(HAParamType.REVENUE, 10.0)
- bundle_pre.putString(HAParamType.CURRNAME, "currency")
- bundle_pre.putString(HAParamType.PLACEID, "location_ID")
- instance.onEvent(HAEventType.ADDPRODUCT2WISHLIST, bundle_pre)
- Bundle bundle = new Bundle();
- bundle.putString("$LotteryName", "name");
- bundle.putString("$LotteryType", "123");
- instance.onEvent("$Lottery", bundle);
- val bundle = Bundle()
- bundle.putString("$LotteryName", "name")
- bundle.putString("$LotteryType", "123")
- instance.onEvent("$Lottery", bundle)
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功