我已按照Google Documentation的步骤进行操作。我已配置分析帐户以显示增强的报告。我已经尝试过来自docs示例的所有posibilites,但我没有得到任何评论。我也尝试过iOS但结果相同。有什么原因吗?:
Product product = new Product()
.setId("P12345")
.setName("Android Warhol T-Shirt")
.setCategory("Apparel/T-Shirts")
.setBrand("Google")
.setVariant("black")
.setPrice(29.20)
.setQuantity(1);
// Add the step number and additional info about the checkout to the action.
ProductAction productAction = new ProductAction(ProductAction.ACTION_CHECKOUT)
.setCheckoutStep(1)
.setCheckoutOptions("Visa");
HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder()
.addProduct(product)
.setProductAction(productAction)
.setCategory("Ecommerce")
.setAction("Checkout start");
tracker.setScreenName("checkoutStep1");
t.send(builder.build());
(我也用ScreenViewBuilder测试了相同的结果)我已经将跟踪器置于详细级别,我获得了以下命中:
12-05 18:16:29.525: V/GAV4(23872): Thread[GAThread,5,main]: Sending hit to service
PATH: https:
PARAMS:
tid=UA-XXXXXXX-6,
t=event,
cos=1,
ht=1417799783734,
aid=com.myapp.debug,
ea=Checkout,
ec=Ecommerce,
cd=checkoutStep1,
pr1id=P12345,
pr1va=black,
pr1ca=Apparel/T-Shirts,
pr1pr=29.20,
pr1cc=APPARELSALE,
pr1nm=Android Warhol T-Shirt,
pr1qt=1,
pr1br=Google,
pa=checkout,
col=Visa,
ate=1,
aiid=com.myapp.app,
an=MyApp,
av=1.0.0,
_u=.KKyADAAAAAAAAAAAL,
ul=ca-es,
sr=720x1280,
a=921530729,
cid=7a02b428-07a9-4c08-9949-5bd15e7159ad,
v=1,
答案 0 :(得分:1)
尝试这样的方式:
public void sendProductAction(ProductInfo productInfo) {
//TODO Add something that we need!
Product product = new Product()
.setId(productInfo.productId)
.setPrice(productInfo.totalAmount)
.setName(productInfo.productName)
.setQuantity(1);
ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE)
.setTransactionId(productInfo.orderId)
.setTransactionAffiliation(productInfo.userId)
.setTransactionRevenue(productInfo.totalAmount);
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder()
.addProduct(product)
.setProductAction(productAction);
Tracker tracker = AnalyticsManager.getInstance().getTracker(TrackerName.ECOMMERCE_TRACKER);
tracker.set("&cu", "EUR");
tracker.send(builder.build());
}
此外,您应该在与您的帐户相关联的控制台中启用增强型电子商务。