Android アプリに Google Analytics Ecomerce トラッキングを実装しています。
GA のドキュメント (以下のコードを参照してください) に基づいて、「トランザクション ID」が必要な新しいTransaction.Builderを作成する必要があります。Google から返された取引 ID ではなく、注文 ID が返されました。- 問題は、トランザクション ID を取得する方法ですか、それとも代わりに注文 ID を使用できますか? 返された注文 ID のサンプル形式は次のとおりです: 12999763169054705758.1356245045384470
/**
* The purchase was processed. We will send the transaction and its associated line items to Google Analytics,
* but only if the purchase has been confirmed.
*/
public void onPurchaseCompleted() {
Transaction myTrans = new Transaction.Builder(
"0_123456", // (String) Transaction Id, should be unique.
(long) (2.16 * 1000000)) // (long) Order total (in micros)
.setAffiliation("In-App Store") // (String) Affiliation
.setTotalTaxInMicros((long) (0.17 * 1000000)) // (long) Total tax (in micros)
.setShippingCostInMicros(0) // (long) Total shipping cost (in micros)
.build();
myTrans.addItem(new Item.Builder(
"L_789", // (String) Product SKU
"Level Pack: Space", // (String) Product name
(long) (1.99 * 1000000), // (long) Product price (in micros)
(long) 1) // (long) Product quantity
.setProductCategory("Game expansions") // (String) Product category
.build());
Tracker myTracker = EasyTracker.getTracker(); // Get reference to tracker.
myTracker.sendTransaction(myTrans); // Send the transaction.
}