gpt4 book ai didi

ios - Google Analytics(分析)增强型电子商务未收到收入

转载 作者:行者123 更新时间:2023-11-30 13:10:30 25 4
gpt4 key购买 nike

在 iOS 上实现增强型电子商务功能后,Google Analytics 电子商务概览显示收入为零。我直接实现了交易测量,没有任何结帐步骤。控制台输出打印正确的收入值以及其他变量,但之后是“http status -1”。我已启动“缺少电子商务数据”通知检查,但已经 3 天了,但仍处于待处理状态。有谁知道如何解决这个问题?

我一直在关注关于电子商务的官方谷歌指南(衡量交易部分): https://developers.google.com/analytics/devguides/collection/ios/v3/enhanced-ecommerce#measuring-transactions

P.S.:Google Analytics 已启用增强型电子商务,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";
}

最佳答案

好的,所以技巧是从 TagManager 中删除自定义调度间隔(应用程序结合了 GA 和 GTM)

tagManager.dispatchInterval = NSTimeInterval(1.0)

设置默认调度间隔(120 秒)并且一切正常后,HTTP 响应代码为 200。

关于ios - Google Analytics(分析)增强型电子商务未收到收入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38790499/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com