Skip to content

Instantly share code, notes, and snippets.

@ronfe
Last active December 14, 2015 14:06
Show Gist options
  • Select an option

  • Save ronfe/ec4a9171402fdab17a20 to your computer and use it in GitHub Desktop.

Select an option

Save ronfe/ec4a9171402fdab17a20 to your computer and use it in GitHub Desktop.

新用户

Count: users from: pc activateDate: 本日

未登录事件UV

Count: events eventKey platform2:pc eventDate: 本日 device

登录事件UV

Count: events eventKey platform2:pc eventDate: 本日 user

"两个以上"UV

  1. eventFlow aggregate {$match: {eventDate, users: {"$in": userList}}}, {$unwind: "$eventFlow"} {$group: {_id: $users, events: {$push: $eventflow}}}

db['temp'].insert_many(group_result) for each in db['temp'].find({}): 找两个以上的那个eventKey

数据周报

视频播放PV

Count: events startVideo数量

总用户数

  • PC总用户数

Count: users from: pc activateDate: {$exists: true}

  • 移动端注册

Count: users from: ["android", "ios"]

  • 移动端未注册

deviceAttr

  1. platform为mobile 的device

2.Count: users为空的device

新增用户数

  • PC新增用户数

Count: users from: pc activateDate: 本周内

  • 移动端注册用户数

Count: users from: [ios, android] activateDate: 本周内

  • 移动端未注册

deviceAttr

  1. activateDate在这一周的device, platform: mobile

2.Count: users为空的device

  • 首次QQ登录

user表, type: qq registTime: 本周

  • 第三方登录

user表, channel: 第三方 registTime: 本周

  • 批量创建激活

user表 type: batch activateDate 本周的

活跃用户数

  • PC端活跃

userAttr PCRecentSession字段在本周内的

  • 移动端活跃
  1. userAttr MobileRecentSession字段在本周内的 = a

  2. deviceAttr users为空,platform为mobile, recentsession在本周内的 = b

  3. a + b

  • 双端活跃

userAttr Pcrecentsession和mobilerecentsession字段都在本周内

首页转化率UV

eventFlow [埋点i是否存在?T: i+1 继续,F: 跳出]

周留存

  • PC周留存
  1. users from: pc activateDate: 上周内 = a

  2. userAttr PCRecentSession字段在本周内的 = b

b/a

  • 移动周留存:
  1. 上周新增: users from: [ios, android] activateDate: 上周内 a = [userId]

移动端未注册

deviceAttr

  1. activateDate在上一周的device, platform: mobile

2.users为空的device b = [deviceId]

  1. 本周活跃:

userAttr MobileRecentSession字段在本周内的 = c

deviceAttr users为空,platform为mobile, recentsession在本周内的 = d

  1. (c+d)/(a+b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment