2014-12-05 88 views
1

的Android/iOS的分析增強電子商務我已經按照從Google Documentation的步驟。我已配置分析帳戶以顯示增強型報告。我從文檔示例中嘗試了所有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具有相同的結果),我已經放在Tracker在詳細級別,我也得到了以下命中:

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小時發命中後... – David 2014-12-05 18:03:27

+0

所以最終出現? – startoftext 2015-05-05 18:09:50

回答

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()); 
} 

此外,您應該在與您的帳戶相關的控制檯中啓用增強型電子商務。