Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
実戦に役立つFirebase_Analytics_使用集
Search
hiroya iizuka
October 15, 2020
0
160
実戦に役立つFirebase_Analytics_使用集
hiroya iizuka
October 15, 2020
Tweet
Share
More Decks by hiroya iizuka
See All by hiroya iizuka
学問と資産
hiroyaiizuka
0
460
clean architecture と経営
hiroyaiizuka
0
1.4k
既存のRESTful な RailsプロジェクトにGraphQL導入を検討した話
hiroyaiizuka
0
5.1k
3つのNext.jsプロジェクトを 新卒エンジニアと一緒に 開発した話
hiroyaiizuka
1
450
ReactNative + microCMS の設計にすごく悩んだ話
hiroyaiizuka
1
1.2k
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
440
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
230
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
52
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
600
Prompt Engineering for Job Search
mfonobong
0
150
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
160
Code Reviewing Like a Champion
maltzj
527
40k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
720
Being A Developer After 40
akosma
91
590k
Transcript
開発に役立つ 開発に役立つ 開発に役立つ 開発に役立つ 開発に役立つ 開発に役立つ Firebase Analytics 実戦集 Firebase
Analytics 実戦集 Firebase Analytics 実戦集 Firebase Analytics 実戦集 Firebase Analytics 実戦集 Firebase Analytics 実戦集 BeatFit CTO 飯塚浩也 BeatFit CTO 飯塚浩也 BeatFit CTO 飯塚浩也 BeatFit CTO 飯塚浩也 BeatFit CTO 飯塚浩也 BeatFit CTO 飯塚浩也 1 / 17
自己紹介 自己紹介 自己紹介 自己紹介 自己紹介 自己紹介 { { "born" "born":
: 1988 1988 年 年, , "career" "career": : Engineer Engineer 1.5 1.5 年 年, , doctor doctor 8 8 年 年 "develop" "develop": : React Native React Native 2.5 2.5 年 年, , Rails Rails 2 2 年 年, , "hobby" "hobby": : drink alchol drink alchol } } 2 / 17
今日のお話 今日のお話 今日のお話 今日のお話 今日のお話 今日のお話 ・ Firebase Analytics 概論
・ Firebase Analytics 概論 ・ Usecase 集 ・ Usecase 集 - Production Debug - Production Debug - Cloud Function - Cloud Function - In App Messaging - In App Messaging 3 / 17
anlaytics.logEvent() anlaytics.logEvent() anlaytics.logEvent() anlaytics.logEvent() anlaytics.logEvent() anlaytics.logEvent() import import { {
Button Button } } from from 'react-native' 'react-native'; ; import import analytics analytics from from '@react-native-firebase/analytics' '@react-native-firebase/analytics'; ; < <Button Button onPress onPress= ={ {async async ( () ) => => await await analytics analytics( () ). .logEvent logEvent( ('basket' 'basket', , { { item item: : 'mens grey t-shirt' 'mens grey t-shirt', , description description: : [ ['round neck' 'round neck', , 'long sleeved' 'long sleeved'] ], , } }) ) } } / /> > 4 / 17
5 / 17
弊社アプリ開発での 弊社アプリ開発での 弊社アプリ開発での 弊社アプリ開発での 弊社アプリ開発での 弊社アプリ開発での ちょっと変わった Analytics Event ちょっと変わった
Analytics Event ちょっと変わった Analytics Event ちょっと変わった Analytics Event ちょっと変わった Analytics Event ちょっと変わった Analytics Event 事例をご紹介します 事例をご紹介します 事例をご紹介します 事例をご紹介します 事例をご紹介します 事例をご紹介します 6 / 17
1. Production debug 1. Production debug 1. Production debug 1.
Production debug 1. Production debug 1. Production debug 7 / 17
ajax ajax . .post post( (url url, , body body,
, HttpService HttpService. .makeHeader makeHeader( (userData userData. .token token) )) ) . .map map( (response response => => { { ... ... // 本番環境で低確率でこの付近の処理が失敗するけど、原因がよくわからない。 // 本番環境で低確率でこの付近の処理が失敗するけど、原因がよくわからない。 return return Observable Observable. .of of( (postLogSuccess postLogSuccess( (response response) )) ) } }) ) . .catch catch( (error error => => { { // エラーが起きて、catch されたのか? // エラーが起きて、catch されたのか? // サーバーのログから、はよくわからない。 // サーバーのログから、はよくわからない。 return return Observable Observable. .of of( (postLogFailure postLogFailure( (error error) )) ) } }) ) 8 / 17
ajax ajax . .post post( (url url, , body body,
, HttpService HttpService. .makeHeader makeHeader( (userData userData. .token token) )) ) . .map map( (response response => => { { // ここにevent を埋めこむ! // ここにevent を埋めこむ! analytics analytics. .logEvent logEvent( ("postHistory" "postHistory") ) return return Observable Observable. .of of( (postLogSuccess postLogSuccess( (response response) )) ) } }) ) . .catch catch( (error error => => { { // ここにevent を埋めこむ // ここにevent を埋めこむ // 第二引数 にerror 情報を渡せる // 第二引数 にerror 情報を渡せる analytics analytics. .logEvent logEvent( ("postHistoryFailure" "postHistoryFailure", , error error) ) return return Observable Observable. .of of( (postLogFailure postLogFailure( (error error) )) ) } }) ) 9 / 17
2. clout functions との連携 2. clout functions との連携 2. clout
functions との連携 2. clout functions との連携 2. clout functions との連携 2. clout functions との連携 10 / 17
logEvent() をトリガー logEvent() をトリガー logEvent() をトリガー logEvent() をトリガー logEvent() をトリガー
logEvent() をトリガー 11 / 17
module module. .exports exports = = functions functions . .analytics
analytics . .event event( ('eventName' 'eventName') ) // トリガー // トリガー . .onLog onLog( (async async( (event event) ) => => { { // 様々なbackend の処理がここにかける! // 様々なbackend の処理がここにかける! } }) ) 12 / 17
3. In App Messaging との連携 3. In App Messaging との連携
3. In App Messaging との連携 3. In App Messaging との連携 3. In App Messaging との連携 3. In App Messaging との連携 13 / 17
analytics event から audience を作成 analytics event から audience を作成
analytics event から audience を作成 analytics event から audience を作成 analytics event から audience を作成 analytics event から audience を作成 14 / 17
Audience で message の範囲を絞る Audience で message の範囲を絞る Audience で
message の範囲を絞る Audience で message の範囲を絞る Audience で message の範囲を絞る Audience で message の範囲を絞る 15 / 17
analytics event をトリガーにする analytics event をトリガーにする analytics event をトリガーにする analytics
event をトリガーにする analytics event をトリガーにする analytics event をトリガーにする 16 / 17
analytics は分析以外にも analytics は分析以外にも analytics は分析以外にも analytics は分析以外にも analytics は分析以外にも
analytics は分析以外にも 工夫次第で、様々な用途に有効! 工夫次第で、様々な用途に有効! 工夫次第で、様々な用途に有効! 工夫次第で、様々な用途に有効! 工夫次第で、様々な用途に有効! 工夫次第で、様々な用途に有効! 17 / 17