【问题标题】:Flutter Firebase Analytics Ecommerce PurchaseFlutter Firebase Analytics 电子商务购买
【发布时间】:2020-11-11 04:26:36
【问题描述】:
Future<void> logEcommercePurchase ( {String currency, double value, String transactionId, double tax, double shipping, String coupon, String location, int numberOfNights, int numberOfRooms, int numberOfPassengers, String origin, String destination, String startDate, String endDate, String travelClass} )

如何使用此 API 记录单件商品的购买情况?几天来,我一直在四处寻找并尝试各种事情,例如在记录电子商务购买之前将商品添加到购物车,但它不起作用。帮忙!

https://pub.dev/documentation/firebase_analytics/latest/firebase_analytics/FirebaseAnalytics/logEcommercePurchase.html

【问题讨论】:

    标签: firebase flutter firebase-analytics


    【解决方案1】:

    我似乎flutterfire仍然使用一个旧事件来跟踪这个,我不知道为什么只跟踪酒店房间的购买。

    Here 他们提到它已被弃用,您应该使用purchase 事件。我还没有测试它,但你可以尝试一下:

    const data = {
                 transaction_id: 'T)ID',
                 value: 1.00,
                 currency: 'USD',
                 tax: 0,
                 shipping: 0,
                 coupon: '',
                 items: [{
                         item_id: 'I_ID',
                         item_name: 'I_NAME',
                         item_list_name: 'IL_NAME',
                         item_list_id: 'IL_ID',
                         item_brand: 'I_B',
                         item_category: 'I_C',
                         item_variant: 'I_V',
                         quantity: 1,
                         price: 1,
                         }]
                   }
                        
    await analytics().logEvent('purchase', data)
    

    【讨论】:

    • 是的,我事先解决了这个问题,但我也这样做了。感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 2011-09-20
    • 1970-01-01
    • 2018-09-04
    • 1970-01-01
    • 2014-09-17
    • 1970-01-01
    • 1970-01-01
    • 2011-10-15
    相关资源
    最近更新 更多