在导出到 BigQuery 的 FirebaseAnalytics 数据中,有些事件的值为 null ga_session_id
In FirebaseAnalytics data exported to BigQuery, there are some events that have null ga_session_id
我正在使用导出到 BigQuery 的 FirebaseAnalytics 数据来分析我们的应用程序。
要检查用户转换,我会像下面这样写 sql。
with users_with_screen_view_and_session_id as (
SELECT
user_id,
user_pseudo_id,
event_date,
event_timestamp,
event_name,
platform,
case
when event.key = 'firebase_screen'
and event.value.string_value is not null then event.value.string_value
when event.key = 'firebase_screen'
and event.value.int_value is not null then cast(event.value.int_value as string)
else null
end as firebase_screen,
case
when event.key = 'ga_session_id'
and event.value.string_value is not null then event.value.string_value
when event.key = 'ga_session_id'
and event.value.int_value is not null then cast(event.value.int_value as string)
else null
end as session_id
FROM
`{my_project}.analytics_{my_id}.events_*` as main
,unnest(event_params) as event
WHERE _TABLE_SUFFIX BETWEEN '20191001' AND '20191001'
and event_name = 'screen_view'
),
users_with_screen_view_agg_firebase_screen as (
select
user_id,
user_pseudo_id,
event_date,
event_name,
platform,
event_timestamp,
max(firebase_screen) as firebase_screen,
max(session_id) as session_id
from
users_with_screen_view_and_session_id
group by
user_id,
user_pseudo_id,
event_date,
event_name,
platform,
event_timestamp
)
select
*
from
users_with_screen_view_agg_firebase_screen
;
我以为每个事件都有ga_session_id
,但在这个查询结果中有一些行ga_session_id
是空的。
什么情况下ga_session_id值会变成null?
查询结果图片在这里。
enter image description here
我正在使用导出到 BigQuery 的 FirebaseAnalytics 数据来分析我们的应用程序。
要检查用户转换,我会像下面这样写 sql。
with users_with_screen_view_and_session_id as (
SELECT
user_id,
user_pseudo_id,
event_date,
event_timestamp,
event_name,
platform,
case
when event.key = 'firebase_screen'
and event.value.string_value is not null then event.value.string_value
when event.key = 'firebase_screen'
and event.value.int_value is not null then cast(event.value.int_value as string)
else null
end as firebase_screen,
case
when event.key = 'ga_session_id'
and event.value.string_value is not null then event.value.string_value
when event.key = 'ga_session_id'
and event.value.int_value is not null then cast(event.value.int_value as string)
else null
end as session_id
FROM
`{my_project}.analytics_{my_id}.events_*` as main
,unnest(event_params) as event
WHERE _TABLE_SUFFIX BETWEEN '20191001' AND '20191001'
and event_name = 'screen_view'
),
users_with_screen_view_agg_firebase_screen as (
select
user_id,
user_pseudo_id,
event_date,
event_name,
platform,
event_timestamp,
max(firebase_screen) as firebase_screen,
max(session_id) as session_id
from
users_with_screen_view_and_session_id
group by
user_id,
user_pseudo_id,
event_date,
event_name,
platform,
event_timestamp
)
select
*
from
users_with_screen_view_agg_firebase_screen
;
我以为每个事件都有ga_session_id
,但在这个查询结果中有一些行ga_session_id
是空的。
什么情况下ga_session_id值会变成null?
查询结果图片在这里。 enter image description here