从最简单的意义上讲,用户留存是指让用户提高粘性,长期使用你的产品。
营销、广告、活动这些都可以让你获得新客户,但是我们要明白,留存对于产品来说,某些程度上远比获客重要得多。一个好的产品加上有效的用户留存策略,这才是长期保持用户参与、活跃和盈利的原因。
最常用的衡量留存率的方法是多日留存分析(N Day Retention),它可以衡量在特定日期有多少用户仍在使用你的产品。
用户留存分析指南 - 蝌蚪互娱的文章 - 知乎 https://zhuanlan.zhihu.com/p/49050001
| recordtime | unionid |
| 2021-11-13 20:05:44 | fgetrf2erxjk54jijas |
create table if not exists liuliang_partition asselect a.*,row_number() over(partition by unionid order by recordtime) rn_asc,row_number() over(partition by unionid order by recordtime desc) rn_descfrom liuliang_detail awhere date(recordtime) >= '2021-01-01' -- 最好根据产品上线时间确定,要不然流量表太大,影响运行效率;
select recorddate,count(distinct unionid) total_uv,count(distinct case when rn_asc = 1 then unionid else null end) new_uv -- 首次访问uv,round(100*count(distinct case when rn_asc = 1 then unionid else null end)/count(distinct unionid), 1) new_uv_ratio -- 首次访问uv占比,count(distinct case when rn_asc <> 1 and diff_days = 1 then unionid else null end) lastday_uv -- 次日留存,count(distinct case when rn_asc <> 1 and diff_days = 2 then unionid else null end) last2day_uv -- 2日留存,count(distinct case when rn_asc <> 1 and diff_days = 3 then unionid else null end) last3day_uv -- 3日留存,count(distinct case when rn_asc <> 1 and diff_days = 4 then unionid else null end) last4day_uv -- 4日留存,count(distinct case when rn_asc <> 1 and diff_days = 5 then unionid else null end) last5day_uv -- 5日留存,count(distinct case when rn_asc <> 1 and diff_days = 6 then unionid else null end) last6day_uv -- 6日留存,count(distinct case when rn_asc <> 1 and diff_days = 7 then unionid else null end) last7day_uv -- 7日留存,count(distinct case when rn_asc <> 1 and diff_days = 14 then unionid else null end) last14day_uv -- 14日留存,count(distinct case when rn_asc <> 1 and diff_days = 30 then unionid else null end) last30day_uv -- 30日留存from(select a.*,date(recordtime) recorddate,datediff(cast(a.recordtime as date), cast(b.recordtime as date)) diff_days -- 留存天数from liuliang_partition aleft join liuliang_partition b on a.unionid = b.unionid and a.rn_asc = b.rn_asc+1) xgroup by recorddate;
文章转载自数分小白龙,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




