iOSの拡張eコマース機能を実装した後、Googleアナリティクスのeコマースの概要の収益はゼロになります。私はチェックアウトの手続きなしに直接トランザクション測定を実装しました。コンソール出力は正しい収益値を他の変数と一緒に表示しますが、その後は "http status -1"となります。 「電子商取引データがありません」という通知のチェックを開始しましたが、既に3日間経過しており、まだ保留中です。誰もこの問題を解決する方法を知っていますか?Googleアナリティクス拡張eコマースが収益を受け取っていない
私は(取引のセクションを測定)ここでeコマースの公式のGoogleガイドを追ってきた: https://developers.google.com/analytics/devguides/collection/ios/v3/enhanced-ecommerce#measuring-transactions
P.S:Google Analyticsのeコマースを有効にして強化されており、GoogleService-のInfo.plistは、プロジェクトに追加されます。
マイコード:出力
static func tagCheckoutFromBookingInfo(bookingInfo: BookingInfo?, discountCode: String?) {
//#if ANALYTICS
let eventData = ProductInfo()
let generalProductDict = eventData.getPayload(bookingInfo?.property, priceInfo: bookingInfo?.propertyPriceInfo(), specificInfo: nil, positionInList: nil)
let product = ecommerceProductFromGeneralProductDict(generalProductDict, discountCode: discountCode)
let builder = GAIDictionaryBuilder.createEventWithCategory(GTMEcommerceKeys.CheckoutCategory.rawValue, action: GTMEcommerceKeys.CheckoutPurchase.rawValue, label: nil, value: nil)
let action = GAIEcommerceProductAction()
action.setAction(kGAIPAPurchase)
action.setTransactionId("T123")
action.setAffiliation(GTMEcommerceKeys.CheckoutAffiliaction.rawValue)
action.setRevenue(NSNumber(double: GTMHelper.priceFromDict(generalProductDict)))
action.setCouponCode(discountCode ?? "")
builder.setProductAction(action)
builder.addProduct(product)
let build: [NSObject: AnyObject] = builder.build() as [NSObject : AnyObject]
tracker.send(build)
//#endif
}
static func ecommerceProductFromGeneralProductDict(dict: [String: AnyObject]?, discountCode: String?) -> GAIEcommerceProduct {
let product = GAIEcommerceProduct()
let productId = (dict?[GTMKeys.ProductId.rawValue] as? String) ?? ""
let productName = (dict?[GTMKeys.ProductName.rawValue] as? String) ?? ""
product.setId(productId)
product.setName(productName)
if discountCode != nil {
product.setCouponCode(discountCode ?? "")
}
if let productCategory = dict?[GTMKeys.ProductType.rawValue] as? String {
product.setCategory(productCategory)
}
product.setPrice(GTMHelper.priceFromDict(dict))
product.setQuantity(NSNumber(integer: 1))
return product
}
コンソール:
2016-08-05 16:41:28.986 Belvilla[1435:339806] VERBOSE: GoogleAnalytics 3.14 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:517): Saved hit: {
parameters = {
"&_crc" = 0;
"&_s" = 3;
"&_u" = ".nteynL";
"&_v" = "mi3.1.4";
"&a" = 655...;
"&aid" = "--------------";
"&an" = Name;
"&ate" = "<null>";
"&av" = "3.4.0";
"&cid" = "f40c6c80-3ec9-43...";
"&dm" = "iPhone6,1";
"&ds" = app;
"&ea" = Purchase;
"&ec" = Ecommerce;
"&el" = "<null>";
"&ev" = "<null>";
"&idfa" = "<null>";
"&pa" = purchase;
"&pr1ca" = "Holiday home";
"&pr1cc" = "";
"&pr1id" = "XX-00-20-00";
"&pr1nm" = "Test House";
"&pr1pr" = "456.7";
"&pr1qt" = 1;
"&sr" = 640x1136;
"&t" = event;
"&ta" = "Booking";
"&tcc" = "";
"&ti" = T123;
"&tid" = "UA-.....";
"&tr" = "456.7";
"&ul" = "en-fr";
"&v" = 1;
"&z" = 740324....;
gaiVersion = "3.14";
};
timestamp = "2016-08-05 13:41:28 +0000";
}