$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Thinking metrics on React apps
Search
Jean Carlo Emer
October 27, 2016
Technology
0
160
Thinking metrics on React apps
Jean Carlo Emer
October 27, 2016
Tweet
Share
More Decks by Jean Carlo Emer
See All by Jean Carlo Emer
Web & Mobile
jcemer
1
190
Cache em aplicações web
jcemer
0
290
Aplicações Web - um estudo sobre React
jcemer
1
190
Lapidando o Globo Play
jcemer
1
260
Desenvolvedor mobile precisa aprender Web
jcemer
1
120
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
610
Tudo o que a web (podia ser) ainda será
jcemer
8
620
Embarque App
jcemer
0
480
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
Ryzen NPUにおけるAI Engineプログラミング
anjn
0
250
なぜ使われないのか?──定量×定性で見極める本当のボトルネック
kakehashi
PRO
1
1.1k
第4回 「メタデータ通り」 リアル開催
datayokocho
0
110
useEffectってなんで非推奨みたいなこと言われてるの?
maguroalternative
10
6.4k
【AWS re:Invent 2025速報】AIビルダー向けアップデートをまとめて解説!
minorun365
4
450
モバイルゲーム開発におけるエージェント技術活用への試行錯誤 ~開発効率化へのアプローチの紹介と未来に向けた展望~
qualiarts
0
610
計算機科学をRubyと歩む 〜DFA型正規表現エンジンをつくる~
ydah
3
130
手動から自動へ、そしてその先へ
moritamasami
0
270
たかが特別な時間の終わり / It's Only the End of Special Time
watany
28
7.8k
21st ACRi Webinar - AMD Presentation Slide (Nao Sumikawa)
nao_sumikawa
0
230
pmconf2025 - データを活用し「価値」へ繋げる
glorypulse
0
660
直接メモリアクセス
koba789
0
270
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Building Flexible Design Systems
yeseniaperezcruz
330
39k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Faster Mobile Websites
deanohume
310
31k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
A better future with KSS
kneath
240
18k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Code Reviewing Like a Champion
maltzj
527
40k
Transcript
Thinking metrics on React apps @jcemer
I work on GloboPlay. globo.com
None
None
React Router 2.0 & Server side render & Client side
user login
1. How can we track our traffic with Google
Analytics?
<PageView location={this.props.location} />
@PureRender class PageView extends Component { static propTypes = {
location: PropTypes.object.isRequired } componentDidMount() { const { action, state } = this.props.location trackPageView(action, state) } componentDidUpdate() { /* */ } }
2. How can we analyse custom data?
Global metrics data: user account info & app version
<DocumentMetrics data={{ appVersion: "2.3" }} />
function handleStateChangeOnClient(vars) { setMetricsDataLayer(vars) } export default withSideEffect( reducePropsToState, handleStateChangeOnClient
)(DocumentMetrics) https://github.com/ gaearon/react-side-effect
3. How can we track the user navigation flow?
Playlist Recommendation
Component metrics: playlist or other lists
<Playlist /> <Recommendation /> <Video /> is a list of
<Video /> is a list of
<Playlist /> <Recommendation /> <Video metrics="playlist" /> is a
list of <Video metrics="recommendation" /> is a list of
<LinkMetrics data="playlist"> <Playlist /> </LinkMetrics> https://facebook.github.io/ react/docs/context.html
class Video extends Component { static contextTypes = { linkMetrics:
PropTypes.object } render() { const state = { metrics: this.context.linkMetrics } return <Link state={state}>/* ... */</Link> } }
* redux should be an option too
Components React side effect Context
Thank you! @jcemer