如何从 Huawei AppGallery Connect 下载我的应用分析数据?

How can I download my app's analytics from Huawei AppGallery Connect?

期待类似于 Google PlayStore 控制台的内容,您可以在其中设置日期和指标,然后下载 csv 文件。

Huawei AppGallery Connect中有类似的东西吗?

到目前为止,我所能做的就是调整日期和一些指标。

仅启用分析服务是不够的。您需要在您的Android/iOS应用程序中添加Analytics Kit,然后才能从AppGallery Connect获取Analytics数据。

HA整合的过程很简单。您可以参考以下步骤或documentation。整合后,您可以在分析页面右下角下载数据。

Analytics Kit 提供服务器API供您导出设备上收集的事件数据,并将数据导入您的BI系统进行统一的数据分析。有关详细信息,请参阅 docs

  • HUAWEI Analytics Kit开发过程:
  1. 将您的应用添加到 AppGallery Connect 后,请启用分析服务以供使用。
  2. 完成启用过程后,从项目设置转到管理 API 选项卡,激活分析服务。
  3. 将项目设置页面的json文件添加到您的项目中,并将HMS SDK依赖项添加到您的项目中。 在依赖项部分添加构建依赖项。
dependencies {
    implementation 'com.huawei.hms:hianalytics:5.0.5.300'
}
  1. agconnect-services.json文件导入成功后,在第一个onCreate方法中初始化Analytics Kitactivity 获取 HiAnalyticsInstance 实例。如果agconnect-services.json文件不正确,则无法在指定的触发点采集数据。
@Override  
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    // Enable SDK log recording.
    HiAnalyticsTools.enableLog();
    HiAnalyticsInstance instance = HiAnalytics.getInstance(this);
    // Or use the context for initialization.
    Context context = this.getApplicationContext();
    HiAnalyticsInstance instance = HiAnalytics.getInstance(context);
    instance.setUserProfile("userKey","value"); 
}
  1. 在代码的适当位置添加自定义事件的触发器。
// Add triggers of custom events in proper positions of the code.
Bundle bundle = new Bundle(); 
bundle.putString("exam_difficulty","high"); 
bundle.putString("exam_level","1-1"); 
bundle.putString("exam_time","20190520-08"); 
instance.onEvent("begin_examination", bundle); 
// Add triggers of predefined events in proper positions of the code.
Bundle bundle_pre = new Bundle(); 
bundle_pre.putString(PRODUCTID, "item_ID"); 
bundle_pre.putString(PRODUCTNAME, "name"); 
bundle_pre.putString(CATEGORY, "category"); 
bundle_pre.putLong(QUANTITY, 100L); 
bundle_pre.putDouble(PRICE, 10.01); 
bundle_pre.putDouble(REVENUE, 10); 
bundle_pre.putString(CURRNAME, "currency"); 
bundle_pre.putString(PLACEID, "location_ID"); 
instance.onEvent(ADDPRODUCT2WISHLIST, bundle_pre);

在开发过程中,可以开启调试模式,实时查看事件记录,观察结果,调整事件上报策略。