首页 > 解决方案 > 使用 logEvent 时无法在 Firebase 分析中获取项目数组

问题描述

根据这个firebase文档,我在网络上使用firebase logEvent函数

我做了什么首先,我初始化了firebase

var firebaseConfig = {
    apiKey: "Xxxxxxxxx",
    authDomain: "Xxxxxxxxx",
    projectId: "Xxxxxxxxx",
    storageBucket: "Xxxxxxxxx",
    messagingSenderId: "Xxxxxxxxx",
    appId: "Xxxxxxxxx",
    measurementId: "Xxxxxxxxx"
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);

然后我使用日志事件方法,就像网站上显示的示例一样

analytics.logEvent('select_content', {
  content_type: 'image',
  content_id: 'P12453',
  items: [{ name: 'Kittens' }]
});

在 Firebase 分析仪表板上,我收到以下参数

  1. content_id
  2. content_type
  3. debug_mode
  4. engagement_time_msec
  5. ga_session_id
  6. ga_session_number
  7. origin
  8. page_location
  9. page_title

但我找不到项目如何找到我的项目参数?谢谢

标签: firebasefirebase-analytics

解决方案


我问了firebase支持,他们给了我答案

似乎您尝试将 ITEMS 参数用于 select_content 事件。请注意,这是不可能的,因为您只能对所有预定义的电子商务事件使用 ITEMS 参数。

因此,您需要遵循有关设置预定义电子商务事件的文档,链接在这里


推荐阅读