【问题标题】:Google Analytics 'items' property not appearing in the dashboard for ecommerce eventsGoogle Analytics(分析)“项目”属性未出现在电子商务事件的仪表板中
【发布时间】:2020-08-09 09:15:45
【问题描述】:

我正在使用 rnfirebase 库 (https://rnfirebase.io/) 对我的 react 本机应用程序进行 Google Analytic 集成。下面的代码 sn-ps 表示我如何使用https://rnfirebase.io/reference/analytics#logAddToCart 方法记录add_to_cart 电子商务事件。

    let addToCartObject = {
        'currency': 'USD',
        'items': [{
            'item_id': itemInfo.productId,
            'item_name': itemInfo.name,
            'item_category': this.state.selectedCategory.category.name,
            'item_variant': '[base]'
        }],
        'value': 33.75
    };
    analytics().logAddToCart(addToCartObject).then(() => {
        console.log(' ---------------- Logging add to cart success ------------- ');
    });

即使事件记录发生时没有任何错误,我也只能通过 Firebase 分析仪表板查看 add_to_cart 事件的 currencyvalue 参数。参数items 总是丢失。我在这里做错了什么或在配置过程中遗漏了什么?

【问题讨论】:

    标签: firebase react-native google-analytics react-native-firebase


    【解决方案1】:

    在对象中添加数量参数以及添加到购物车的值。

    【讨论】:

    • 我尝试在项目级别和根级别添加quantityitem_quantity,但日志记录失败,显示参数无效。甚至文档 (rnfirebase.io/reference/analytics/item) 也没有提到 quantity 参数。
    猜你喜欢
    • 2017-10-09
    • 1970-01-01
    • 2011-08-01
    • 1970-01-01
    • 2018-09-11
    • 2018-12-11
    • 2013-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多