Android上的数据缺失增强了电子商务分析页面 [英] Missing data on Android enhanced e-commerce analytics page
问题描述
我使用google-analytics SDK测量了我的Android应用结帐效果。我创建了一个Wrapper,用于发送匹配(以及它的工作原理)和异常(它也可以)。我只是不能使它与电子商务数据一起工作。
为了发送电子商务数据,我创建了一个产品和一个productAction
Product product = new Product()
.setId(ID)
.setCategory(category)
.setBrand(brandID)
.setCustomDimension(1,typology)
.setCustomDimension(2,currency)
.setPrice(getTotal())
.setQuantity(1);
//将关于结帐的步骤编号和附加信息添加到操作中。
ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE)
.setCheckoutStep(4)
.setCheckoutOptions(Perform payment);
然后
sendEcommerceCheckoutStep(product,productAction,performPayment,getApplicationContext())
表示方法的主体是
public void sendEcommerceCheckoutStep(Product product,ProductAction productAction,String checkoutStepName,Context context){
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder()
.addProduct(product)
.setProductAction(productAction)
.addImpression(product,checkoutStepName);
mTracker.setScreenName(checkoutStepName);
mTracker.send(builder.build());
mTracker.setScreenName(null);
}
现在,我预计数据会流经分析工具(而且,我检查了adb日志),但我无法在分析Web界面中看到它。
这就是我在分析界面上看到的:
正如您所看到的,唯一获取数据的列是购物车到详细费率一个。但是,如果我在其他栏目中没有任何数据,我该如何获得购物车到详细费率?
这是产品性能屏幕。这是产品列表性能:
全部其他列也是0。为什么它列出了添加到购物车操作,但没有列出其他操作?为解决方案
我已遵循
例如,您会看到收入和畅销书。
I'm measuring my Android app checkout performance by using the google-analytics SDK. I created a Wrapper that I use in order to send hits (and it works) and exceptions (it works as well). I just can't make it work with eCommerce data.
In order to send ecommerce data i create a product and a productAction
Product product = new Product()
.setId(ID)
.setCategory(category)
.setBrand(brandID)
.setCustomDimension(1, typology)
.setCustomDimension(2, currency)
.setPrice(getTotal())
.setQuantity(1);
// Add the step number and additional info about the checkout to the action.
ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE)
.setCheckoutStep(4)
.setCheckoutOptions("Perform payment");
and then
sendEcommerceCheckoutStep(product, productAction, "performPayment", getApplicationContext())
the body of said method is
public void sendEcommerceCheckoutStep(Product product, ProductAction productAction, String checkoutStepName, Context context) {
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder()
.addProduct(product)
.setProductAction(productAction)
.addImpression(product, checkoutStepName);
mTracker.setScreenName(checkoutStepName);
mTracker.send(builder.build());
mTracker.setScreenName(null);
}
Now, I'd expect data to flow through analytics (and it does, I checked the adb logs) but I can't see it in analytics web interface.
This is what I see on analytics web interface:
As you can see the only column which got data is the "Cart-to-Detail Rate" one. But how can I have a cart-to-detail rate if I don't have any data in any other column?
This was the "product performance" screen. This is the "Product list performance":
all other columns are 0 as well. Why did it list the "add to cart" actions but not the others?
The following code is working on my app. I have followed the official transaction guide.
I found a few differences with yours. E.g. the name of the screen name, I don't set it to null later, I don't set the checkout step, I don't set custom dimensions nor impressions.
Feel free to try it:
public void trackPurchase(@NonNull TrackingPurchase trackingPurchase) {
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder();
for (TrackingProduct trackingProduct : trackingPurchase.getTrackingProducts()) {
builder.addProduct(this.createProduct(trackingProduct));
}
builder.setProductAction(this.createProductAction(trackingPurchase));
googleAnalyticsTracker.setScreenName("transaction");
googleAnalyticsTracker.set("&cu", "USD");
googleAnalyticsTracker.send(builder.build());
}
@NonNull
private Product createProduct(@NonNull TrackingProduct trackingProduct) {
return new Product()
.setId(trackingProduct.getSku())
.setName(trackingProduct.getName())
.setCategory(trackingProduct.getCategory())
.setPrice(trackingProduct.getPrice())
.setQuantity(trackingProduct.getQuantity());
}
@NonNull
private ProductAction createProductAction(@NonNull TrackingPurchase trackingPurchase) {
return new ProductAction(ProductAction.ACTION_PURCHASE)
.setTransactionId(trackingPurchase.getSaleId())
.setTransactionAffiliation("Android App")
.setTransactionRevenue(trackingPurchase.getRevenue())
.setTransactionTax(0)
.setTransactionShipping(trackingPurchase.getShippingCost())
.setTransactionCouponCode(trackingPurchase.getCouponCode());
}
TrackingPurchase
is a class that just contains the various TrackingProduct
which are data to be tracked.
I can see this tracked by checking here:
For example, you will see revenue and top sellers.
这篇关于Android上的数据缺失增强了电子商务分析页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!