0

私は実際にはこれに答えを見つけることができませんでした非常に驚いている、私は非常に一般的な質問でなければならないと思う。Googleアナリティクス拡張eコマース - setPriceは合計または1つである必要がありますか?

私はアプリケーションに分析トラッキングを実装しましたが、わからないことは、製品に設定されている価格が単一の製品価格か最終製品価格(数量x単価)であるかどうかということです。

したがって、基本的にどちらを以下から選択する必要がありますか?

String productId = "123"; 
String productName = "Grimlock Action Figure"; 
String productCategory = "Toys"; 
String productVariant = "Transformers Robots in Disguise"; 
String productBrand = "Hasbro"; 
int quantity = 3; 
double singleToyPrice = 19.99; 
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder(); 
ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE) 
     .setTransactionId("1234567890"); 

は私が

a)は1つだけのユニット

Product product = new Product() 
     .setId(productId) 
     .setName(productName) 
     .setCategory(productCategory) 
     .setBrand(productBrand) 
     .setVariant(productVariant) 
     .setPrice(singleToyPrice) // 19.99 
     .setQuantity(quantity); // 3 
builder.addProduct(product) 
     .setProductAction(productAction); 

Bの価格で製品を追加)掛けてください:

のは、私は、製品データやビルダーを持っているとしましょう数量のある単価

Product product = new Product() 
     .setId(productId) 
     .setName(productName) 
     .setCategory(productCategory) 
     .setBrand(productBrand) 
     .setVariant(productVariant) 
     .setPrice((double) quantity * singleToyPrice) // 3 * 19.99 = 59.97 
     .setQuantity(quantity); // 3 
builder.addProduct(product) 
     .setProductAction(productAction); 

C)単一価格で同じトランザクションに製品の数量回を追加

for (int i = 0; i < quantity; i++) { 
    Product product = new Product() 
      .setId(productId) 
      .setName(productName) 
      .setCategory(productCategory) 
      .setBrand(productBrand) 
      .setVariant(productVariant) 
      .setPrice(singleToyPrice) // 19.99 
      .setQuantity(1); // 1 
    builder.addProduct(product) 
      .setProductAction(productAction); 
} 

ただ、分析が正しい金額を計算になりますどちら不思議?

よろしく、それをテストして DPD

+1

単一の製品価格を設定する必要があります(たとえば、単一の製品価格にその製品のすべてのトランザクションの合計数を掛けた製品のパフォーマンスレポートで使用されます)。 –

答えて

0

、それは間違いなく(A)です。 @EikePierstoriffに助けてくれてありがとう。

String productId = "123"; 
String productName = "Grimlock Action Figure"; 
String productCategory = "Toys"; 
String productVariant = "Transformers Robots in Disguise"; 
String productBrand = "Hasbro"; 
int quantity = 3; 
double singleToyPrice = 19.99; 
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder(); 
ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE) 
    .setTransactionId("1234567890"); 

Product product = new Product() 
    .setId(productId) 
    .setName(productName) 
    .setCategory(productCategory) 
    .setBrand(productBrand) 
    .setVariant(productVariant) 
    .setPrice(singleToyPrice) // 19.99 
    .setQuantity(quantity); // 3 
builder.addProduct(product) 
    .setProductAction(productAction); 

これは現在解決/終了できます。

関連する問題