填充AWS Mobile Analytics收入图表

时间:2014-09-12 06:47:28

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

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

revenue

如何填充“收入”标签?我是否必须使用Google应用程序内购买,FB付款或亚马逊付款来实际购买我的应用程序才能填充它?当用户进行购买时,它会自动填充吗?或者是否有某个API调用,我可以调用它来填充这些值?

这个问题听起来很愚蠢,但老实说我找不到合适的文件,测试付款需要一段时间,因为我对我用于此PoC的帐户的控制有限。

1 个答案:

答案 0 :(得分:2)

假设您使用的是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