Upgrade to Pro — share decks privately, control downloads, hide ads and more …

アプリのログをチーム外で活用してもらうためにやったこと

 アプリのログをチーム外で活用してもらうためにやったこと

Mobile 勉強会 Wantedly x チームラボ #5 で発表したスライドになります
https://wantedly.connpass.com/event/244011/

2f8b61ad31dd9c6ada4a90af746290fd?s=128

Shota Kashihara

May 17, 2022
Tweet

More Decks by Shota Kashihara

Other Decks in Programming

Transcript

  1. ©2022 Wantedly, Inc. ΞϓϦͷϩάΛνʔϜ֎Ͱ׆༻ ͯ͠΋Β͏ͨΊʹ΍ͬͨ͜ͱ .PCJMFษڧձ Shota Kashihara @kashihararara

  2. ©2022 Wantedly, Inc. λΠτϧͷิ଍Ͱ͢ ΞϓϦͷϩάΛ → Treasure Data / Google

    Analytics for Firebase ͷϩά νʔϜ֎Ͱ → ϞόΠϧΞϓϦνʔϜҎ֎ͷϝϯόʔ ׆༻͢Δ → ໨తͷࢦඪʹ͍ͭͯूܭ͢Δ͜ͱ ࠷ॳʹ
  3. ©2022 Wantedly, Inc. 5SFBTVSF%BUB("GPS'JSFCBTFͷϩάΛ ϞόΠϧΞϓϦνʔϜҎ֎ͷϝϯόʔ͕ ໨తͷࢦඪʹ͍ͭͯࣗ༝ʹूܭ͢ΔͨΊʹ΍ͬͨ͜ͱ .PCJMFษڧձ Shota Kashihara @kashihararara

  4. ©2022 Wantedly, Inc. ཧ૝ͱݱ࣮

  5. ©2022 Wantedly, Inc. ՝୊ ΞϓϦͷϩά ΞϓϦΤϯδχΞ ඇΞϓϦΤϯδχΞ ࣮૷ ར༻ ཧ૝

  6. ©2022 Wantedly, Inc. ՝୊ ΞϓϦͷϩά ΞϓϦΤϯδχΞ ඇΞϓϦΤϯδχΞ ूܭ ґཔ ݱ࣮

  7. ©2022 Wantedly, Inc. ՝୊ ϩάར༻ʹ͔͔Δ༷ʑͳϋʔυϧ w ͭͷUBCMF EBUBTFUʹશͯͷϩά͕ೖ͍ͬͯΔ w ཉ͍͠ϩάʹରԠ͢ΔFWFOU@OBNF

    FWFOU@QBSBNT͕Θ͔Βͳ͍ w TDIFNF͕ͳ͍ w FWFOU@OBNF FWFOU@QBSBNTͷ੾Γํ͕όϥόϥ w ҉໧஌ͷ਺ʑ w J04 "OESPJEͰFWFOU@OBNF͕ҟͳΔ w J04 "OESPJE͓Αͼ࢞ຓΞϓϦͷϩά΋ಉҰUBCMFʹೖ͍ͬͯΔ w 4XJGU΍,PUMJOͷΫϥε໊΍࣮૷༝དྷͷ஋͕ϩάʹೖ͍ͬͯΔ w ೥લʹFWFOU@OBNFͷUZQPΛ௚ͨ͠FUD
  8. ©2022 Wantedly, Inc. ՝୊ -- εΫϦʔϯϩάΛूܭ͢Δ View select case (

    select value.string_value from unnest(event_params) where key = "screen_name" ) when "UserViewController" then "Ϣʔβʔը໘" when "SettingViewController" then "ઃఆը໘" ... -- @ը໘਺͚ͩ else "" end, ... -- user_id ͳͲ from `<project>.analytics.events_*` where _table_suffix = "20220401" and event_name = "screen_event" and app_info.id = "com.wantedly.app" w ը໘ͱΫϥε໊ͷରԠΛ஌ͬͯ ͍Δ ඞཁ͕͋Δ w εΫϦʔϯϩάͷFWFOU@OBNF Λ஌͍ͬͯΔ w ໨తͷΞϓϦͷCVOEMF JEFOUJ fi FSΛ஌͍ͬͯΔ ूܭ͢ΔͨΊʹɺ஌Βͳ͍ͱ͍͚ͳ͍͜ͱ͕ଟ͍
  9. ©2022 Wantedly, Inc. ՝୊ ॱ൪ʹϩάΛ੔ཧ͍ͯ͘͠ w ෼ੳ͠΍͍͢ܗʹΠϕϯτͷཻ౓Λἧ͑Δ w ҙຯͷ͋Δ୯ҐͰ7JFXΛ࡞Δ w

    ࡞ͬͨ7JFXͷΫΤϦΛ(JU)VCͰ؅ཧ͢Δ
  10. ©2022 Wantedly, Inc. ෼ੳ͠΍͍͢ܗʹΠϕϯτͷཻ౓Λἧ͑Δ τοϓϨϕϧͷFWFOU@OBNFʹ͢΂ͯͷΠϕϯτΛྻڍ͢ΔͷͰ͸ͳ͘ɺΠϕϯτΛΧ ςΰϦ͝ͱʹू໿͢Δ ޙड़͢ΔɺFWFOU@OBNFͰ·ͱ·ͬͨ7JFXΛ࡞ΔͨΊͷԼ४උ enum EventName {

    case tapControl(name: TapControlName) ... } enum TapControlName { case userShareButton(userId: String) case companyShareButton(companyId: String) ... }
  11. ©2022 Wantedly, Inc. enum EventName { // DO NOT EDIT

    extension Event { var name: String { switch self { case .tapControl: return "tap_control" } } var params: [String: Any] { switch self { case .tapControl(name): switch name { case .userShareButton(let userId): return ["name": "user_share_button", "user_id": userId] case .companyShareButton(let companyId): return ["name": "company_share_button", "company_id": companyId] } } } } TUFDJM 📄
  12. ©2022 Wantedly, Inc. ҙຯͷ͋Δ୯ҐͰ7JFXΛ࡞Δ શͯͷϩά͕ೖ͍ͬͯΔςʔϒϧ͔ΒɺΧςΰϦ͝ͱʹ7JFXΛ੾Γग़͢ ඇΞϓϦΤϯδχΞ ཁٻ͞ΕΔ༷ʑͳ҉໧஌ BOBMZUJDTFWFOUT@ -- εΫϦʔϯϩάΛूܭ͢Δ

    View select case ( select value.string_value from unnest(event_params) where key = "screen_name" ) when "UserViewController" then "Ϣʔβʔը໘" when "SettingViewController" then "ઃఆը໘" ... -- @ը໘਺͚ͩ else "" end, ... -- user_id ͳͲ from `<project>.analytics.events_*` where _table_suffix = "20220401" and event_name = "screen_event" and app_info.id = "com.wantedly.app"
  13. ©2022 Wantedly, Inc. ҙຯͷ͋Δ୯ҐͰ7JFXΛ࡞Δ શͯͷϩά͕ೖ͍ͬͯΔςʔϒϧ͔ΒɺΧςΰϦ͝ͱʹ7JFXΛ੾Γग़͢ ඇΞϓϦΤϯδχΞ ҉໧஌ΛӅṭͨ͠7JFX -- εΫϦʔϯϩάΛूܭ͢Δ View

    select * from `ios_screen_view` JPT@TDSFFO@WJFX JPT@TDSFFO@WJFX JPT@TDSFFO@WJFX BOBMZUJDTFWFOUT@ -- εΫϦʔϯϩάΛूܭ͢Δ View select case ( select value.string_value from unnest(event_params) where key = "screen_name" ) when "UserViewController" then "Ϣʔβʔը໘" when "SettingViewController" then "ઃఆը໘" ... -- @ը໘਺͚ͩ else "" end, ... -- user_id ͳͲ from `<project>.analytics.events_*` where _table_suffix = "20220401" and event_name = "screen_event" and app_info.id = "com.wantedly.app"
  14. ©2022 Wantedly, Inc. ҙຯͷ͋Δ୯ҐͰ7JFXΛ࡞Δ 7JFXΛ૊Έ߹ΘͤΔ w ఆٛࡁΈ7JFXΛ࠶ར༻͢Δ͜ͱͰෳࡶ౓Λ཈͑ͳ͕Β༷ʑͳूܭΛՄೳʹ͢Δ select count(receive.id) receive_count,

    count(open.id) open_count, count(open.id) / count(receive.id) open_rate, from `ios_receive_push_notifications` receive left outer join `ios_open_push_notifications` open using (id) w ྫ ϓογϡ௨஌ͷड৴ϩά ։෧ϩάϓογϡ௨஌ͷ։෧཰ͷूܭ
  15. ©2022 Wantedly, Inc. ࡞ͬͨ7JFXͷΫΤϦΛ(JU)VCͰ؅ཧ͢Δ #JH2VFSZͷ7JFX΍6%'Λ(JU)VCͰ؅ཧ͢ΔπʔϧSFSPTUCRW https://www.wantedly.com/companies/wantedly/post_articles/286165

  16. ©2022 Wantedly, Inc. ࡞ͬͨ7JFXͷΫΤϦΛ(JU)VCͰ؅ཧ͢Δ #JH2VFSZͷ7JFX΍6%'Λ(JU)VCͰ؅ཧ͢ΔπʔϧSFSPTUCRW w ΫΤϦͷϨϏϡʔ͕ग़དྷΔ w ΫΤϦͷଐਓԽɺൿ఻ͷλϨԽΛ๷͙

  17. ©2022 Wantedly, Inc. ՝୊ ΞϓϦͷϩά ΞϓϦΤϯδχΞ ඇΞϓϦΤϯδχΞ ूܭ ґཔ ݱ࣮

  18. ©2022 Wantedly, Inc. ՝୊ 7JFX ΞϓϦΤϯδχΞ ඇΞϓϦΤϯδχΞ ࣮૷ ར༻ ݱࡏ

    ΞϓϦͷϩά
  19. ©2022 Wantedly, Inc. ͓͞Β͍ ॱ൪ʹϩάΛ੔ཧ͍ͯ͘͠ w ෼ੳ͠΍͍͢ܗʹΠϕϯτͷཻ౓Λἧ͑Δ w ҙຯͷ͋Δ୯ҐͰ7JFXΛ࡞Δ w

    ࡞ͬͨ7JFXͷΫΤϦΛ(JU)VCͰ؅ཧ͢Δ
  20. ϖʔδλΠτϧ ϖʔδαϒλΠτϧ ©2022 Wantedly, Inc. 5IBOLT