简体   繁体   English

BigQuery Export模式-如何从Firebase导出完整的事件列

[英]BigQuery Export schema - how to export complete event column from firebase

I already link the firebase to bigquery, and everyday a new table gets created with the date stamp. 我已经将firebase链接到bigquery,并且每天都有一个带有日期戳的新表被创建。 The columns within the export can be found in the following link: https://support.google.com/firebase/answer/7029846?hl=en BUT, there is not firebase analytics data(such as add_porduct_like, add_product_to_cart, and so on) being export. 可以在以下链接中找到导出中的列: https : //support.google.com/firebase/answer/7029846?hl=zh_CN但是,没有Firebase分析数据(例如add_porduct_like,add_product_to_cart等) )正在出口。 how can I export complete data into BigQuery. 如何将完整数据导出到BigQuery。

Firebase Analytics data is already exported in those daily tables formed each day in Big Query. Firebase Analytics数据已经导出到Big Query中每天形成的那些日常表格中。

What is required over here is to run queries in order to extract the relevant data. 在此所需的是运行查询以提取相关数据。

Take a look at this doc for sample queries when Firebase Data is exported to Big Query. 将Firebase数据导出到Big Query时,请查看此文档中的示例查询。

In short, you need to make use of the schema and based on the Field Name, you can query the data obtained in Big Query by Firebase. 简而言之,您需要使用架构,并且可以基于字段名称查询Firebase在Big Query中获取的数据。

When you submit an event with parameters to Firebase Analytics, it is stored as an array in the column event_dim.params . 当您将带有参数的事件提交给Firebase Analytics时,该事件将作为数组存储在event_dim.params列中。 To get data from database, you will need to use this query (I'm using standard SQL): 要从数据库获取数据,您将需要使用以下查询(我使用的是标准SQL):

SELECT 
  event_dim.name AS event_name, 
  event_dim.params AS event_params

FROM 
  `project.your_app.app_events_20171109`,
  UNNEST(event_dim) as event_dim

If you want to get specific parameter, you'll also have to unnest another field: 如果要获取特定参数,则还必须取消嵌套另一个字段:

SELECT 
  event_dim.name AS event_name, 
  event_dim.params AS event_params

FROM 
  `project.your_app.app_events_20171109`,
  UNNEST(event_dim) as event_dim,
  UNNEST(event_dim.params) as params

WHERE params.key LIKE "add_product_to_cart"

You can read more about how Firebase Analytics stores data and how to use UNNEST function here: https://firebase.googleblog.com/2017/03/bigquery-tip-unnest-function.html 您可以在此处阅读有关Firebase Analytics如何存储数据以及如何使用UNNEST函数的更多信息: https ://firebase.googleblog.com/2017/03/bigquery-tip-unnest-function.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM