- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我偶然发现了这个标准 SQL BigQuery documentation本周,这让我开始使用 Firebase Analytics 封闭漏斗。然而,我得到了错误的结果(查看下图)。在没有首先开始“Tutorial_LessonStarted >> Lesson = 1”之前,应该没有用户拥有“Tutorial_LessonCompleted”。这可能是由于各种原因。
问题:
#standardSQL
SELECT
step1, step2, step3, step4, step5, step6,
COUNT(*) AS funnel_count,
COUNT(DISTINCT user_id) AS users
FROM (
SELECT
user_dim.app_info.app_instance_id AS user_id,
event.timestamp_micros AS event_timestamp,
event.name AS step1,
LEAD(event.name, 1) OVER (
PARTITION BY user_dim.app_info.app_instance_id
ORDER BY event.timestamp_micros ASC) as step2,
LEAD(event.name, 2) OVER (
PARTITION BY user_dim.app_info.app_instance_id
ORDER BY event.timestamp_micros ASC) as step3,
LEAD(event.name, 3) OVER (
PARTITION BY user_dim.app_info.app_instance_id
ORDER BY event.timestamp_micros ASC) as step4,
LEAD(event.name, 4) OVER (
PARTITION BY user_dim.app_info.app_instance_id
ORDER BY event.timestamp_micros ASC) as step5,
LEAD(event.name, 5) OVER (
PARTITION BY user_dim.app_info.app_instance_id
ORDER BY event.timestamp_micros ASC) as step6
FROM
`......`,
UNNEST(event_dim) AS event,
UNNEST(user_dim.user_properties) AS user_prop
WHERE user_prop.key = "first_open_time"
ORDER BY 1, 2, 3, 4, 5 ASC
)
WHERE step6 = "Tutorial_LessonStarted" AND EXISTS (
SELECT *
FROM `......`,
UNNEST(event_dim) AS event,
UNNEST(event.params)
WHERE key = 'LessonNumber' AND value.string_value = "lesson1") GROUP BY step1, step2, step3, step4, step5, step6
ORDER BY funnel_count DESC
LIMIT 100;
project_id.com_game_example_IOS.app_events_20170212
, 最佳答案
让我进行一些解释,然后看看我是否可以建议一个查询来帮助您入门。
看起来您想分析分析数据中的事件序列,但序列已经为您准备好了——您有一个事件数组。看着Firebase schema for BigQuery , event_dim
是相关的列,除非我有什么误解,否则这些事件是按时间排序的。如果要检查第六个事件的名称,可以使用:
event_dim[SAFE_ORDINAL(6)].name
NULL
如果事件少于六个,否则它将为您提供带有事件名称的字符串。
event_dim
和
user_dim
,但是您正在取两者的叉积,这将爆炸行数并且难以推理查询的结果。要查找特定的用户属性,请使用以下形式的表达式:
(SELECT value.value.string_value
FROM UNNEST(user_dim.user_properties)
WHERE key = 'first_open_time') = '<expected property value>'
FROM
和
WHERE
子句看起来像这样:
FROM `project_id.com_game_example_IOS.app_events_*`
WHERE _TABLE_SUFFIX = '20170701' AND
event_dim[SAFE_ORDINAL(6)].name = 'Tutorial_LessonStarted' AND
(SELECT value.value.string_value
FROM UNNEST(user_dim.user_properties)
WHERE key = 'first_open_time') = '<expected property value>'
event_dim
中的步骤,我们可以这样做:
WITH FilteredInput AS (
SELECT *
FROM `project_id.com_game_example_IOS.app_events_*`
WHERE _TABLE_SUFFIX = '20170701' AND
event_dim[SAFE_ORDINAL(6)].name = 'Tutorial_LessonStarted' AND
(SELECT value.value.string_value
FROM UNNEST(user_dim.user_properties)
WHERE key = 'first_open_time') = '<expected property value>' AND
-- ensure that an event with lesson1 precedes Tutorial_LessonStarted
EXISTS (
SELECT 1
FROM UNNEST(event_dim) WITH OFFSET event_offset
CROSS JOIN UNNEST(params)
WHERE key = 'LessonNumber' AND
value.string_value = 'lesson1' AND
event_offset < 5
)
)
SELECT
event_dim[ORDINAL(1)].name AS step1,
event_dim[ORDINAL(2)].name AS step2,
event_dim[ORDINAL(3)].name AS step3,
event_dim[ORDINAL(4)].name AS step4,
event_dim[ORDINAL(5)].name AS step5,
event_dim[ORDINAL(6)].name AS step6,
COUNT(*) AS funnel_count,
COUNT(DISTINCT user_dim.user_id) AS users
FROM FilteredInput
GROUP BY step1, step2, step3, step4, step5, step6;
关于google-analytics - 通过 BigQuery 访问 Firebase 封闭漏斗中的结构和数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45619643/
我遇到了这个 d3 Funnel Library 的问题 我目前正在使用此设置来使图表响应加载: var data = [ [ "Clicked", "5,000" ], [ "Joi
我的任务是创建一个如下所示的漏斗... 我看过一些例子here和 here并且还发现了以下 link但我无法让漏斗侧放。我什至不确定我是否在寻找正确的东西。 以前有没有人创造过类似的东西。 已更新这是
有人用过 Highchart Funnel for Angular 吗? 我使用 highchart-ng ( https://github.com/pablojim/highcharts-ng ),
我正在考虑实现 User Id用于谷歌分析。这基本上是一种告诉 Google Analytics 登录用户是否相同的方法,即使他们来自不同的设备。 谷歌表示,如果我以匿名用户身份登录,然后提供用户 I
我是一名优秀的程序员,十分优秀!