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

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

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

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

Shota Kashihara

May 17, 2022
Tweet

More Decks by Shota Kashihara

Other Decks in Programming

Transcript

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

    View full-size slide

  2. ©2022 Wantedly, Inc.
    λΠτϧͷิ଍Ͱ͢
    ΞϓϦͷϩάΛ → Treasure Data / Google Analytics for Firebase ͷϩά
    νʔϜ֎Ͱ → ϞόΠϧΞϓϦνʔϜҎ֎ͷϝϯόʔ
    ׆༻͢Δ → ໨తͷࢦඪʹ͍ͭͯूܭ͢Δ͜ͱ
    ࠷ॳʹ

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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 `.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Λ஌͍ͬͯΔ
    ूܭ͢ΔͨΊʹɺ஌Βͳ͍ͱ͍͚ͳ͍͜ͱ͕ଟ͍

    View full-size slide

  9. ©2022 Wantedly, Inc.
    ՝୊
    ॱ൪ʹϩάΛ੔ཧ͍ͯ͘͠
    w ෼ੳ͠΍͍͢ܗʹΠϕϯτͷཻ౓Λἧ͑Δ
    w ҙຯͷ͋Δ୯ҐͰ7JFXΛ࡞Δ
    w ࡞ͬͨ7JFXͷΫΤϦΛ(JU)VCͰ؅ཧ͢Δ

    View full-size slide

  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)


    ...


    }


    View full-size slide

  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
    📄

    View full-size slide

  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 `.analytics.events_*`


    where _table_suffix = "20220401"


    and event_name = "screen_event"


    and app_info.id = "com.wantedly.app"

    View full-size slide

  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 `.analytics.events_*`


    where _table_suffix = "20220401"


    and event_name = "screen_event"


    and app_info.id = "com.wantedly.app"

    View full-size slide

  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 ྫ
    ϓογϡ௨஌ͷड৴ϩά։෧ϩάϓογϡ௨஌ͷ։෧཰ͷूܭ

    View full-size slide

  15. ©2022 Wantedly, Inc.
    ࡞ͬͨ7JFXͷΫΤϦΛ(JU)VCͰ؅ཧ͢Δ
    #JH2VFSZͷ7JFX΍6%'Λ(JU)VCͰ؅ཧ͢ΔπʔϧSFSPTUCRW
    https://www.wantedly.com/companies/wantedly/post_articles/286165

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  20. ϖʔδλΠτϧ ϖʔδαϒλΠτϧ
    ©2022 Wantedly, Inc.
    5IBOLT

    View full-size slide