android - 填充 AWS Mobile Analytics 收入图表

标签 android amazon-web-services analytics mobile-analytics amazon-mobile-analytics

我正在开发一个概念验证 Android 应用程序,该应用程序使用 AWS Mobile Analytics 来跟踪应用程序中的 session 和事件。我能够暂停和恢复 session ,并创建自定义事件,所有内容都会按预期反射(reflect)在相应的图表中。现在,在移动分析控制台中,有一些图表显示收入或与收入有关的某些指标(ARPDAU、ARPPDAU),以及收入选项卡,所有这些目前没有任何值。目前我的每用户终身值(value)如下所示:

revenue

收入选项卡如何填充?我是否必须使用 Google 应用内购买、FB 付款或亚马逊付款来实际购买某些东西才能填充?当用户购买时,它会自动填充吗?或者是否有 API 调用可供我调用来填充这些值?

这个问题听起来很愚蠢,但老实说,我找不到与此相关的像样的文档,并且测试付款需要我一段时间,因为我对此 PoC 使用的帐户的控制有限。

最佳答案

假设您使用的是 AWS Android (Java) SDK,看起来他们有一个用于发送获利事件的构建器模式。

http://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/

他们对每种类型的商店都有单独的模式,因此 Google Play 的代码如下所示:(无耻地从文档中复制)

// get the event client from your MobileAnalyticsManager instance
EventClient eventClient = mobileAnalyticsManager.getEventClient();

// create a builder that can record purchase events for Google Play IAP
GooglePlayMonetizationEventBuilder builder = GooglePlayMonetizationEventBuilder.create(eventClient);

// build the monetization event with the product id, formatted item price, transaction id, and quantity
// product id and formatted item price can be obtained from the JSONObject returned by a product sku request to Google's In App Billing API
// transaction id is obtained from the Purchase object that is returned upon the completion of a purchase
// Google IAP currently only supports a quantity of 1
Event purchaseEvent = builder.withProductId(sku).withFormattedItemPrice(price).withTransactionId(purchase.getOrderId()).withQuantity(1).build();

// record the monetization event
eventClient.recordEvent(purchaseEvent);

Page where sample code is taken

For Amazon in-app purchase

For FB purchase, I'd assume

关于android - 填充 AWS Mobile Analytics 收入图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25802359/

相关文章:

android - 使用 OkHttp、Okio 和 RxJava 下载文件

amazon-web-services - Amazon ElasticBeanStalk Worker Tier 无法连接到 SQS

javascript - angular 和 google analytics 集成 => ga 不是函数

java - 如何解决 .gradle/wrapper 找不到

android - 未知属性 android

amazon-web-services - 为什么 base64 是 sha1/sha256 哈希?

amazon-web-services - 将 OpenAPI 规范中描述的 REST API 转换为 Terraform 模板中描述的 AWS API Gateway REST API

java - Google 测量协议(protocol)不会在 GA 中记录命中。从浏览器工作正常

java - 语句执行的次数(以 n 为单位)

android - 在android中为多个像素更改图像png的颜色?