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
Thinking metrics on React apps
Search
Jean Carlo Emer
October 27, 2016
Technology
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Thinking metrics on React apps
Jean Carlo Emer
October 27, 2016
More Decks by Jean Carlo Emer
See All by Jean Carlo Emer
Web & Mobile
jcemer
1
210
Cache em aplicações web
jcemer
0
340
Aplicações Web - um estudo sobre React
jcemer
1
220
Lapidando o Globo Play
jcemer
1
290
Desenvolvedor mobile precisa aprender Web
jcemer
1
150
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
640
Tudo o que a web (podia ser) ainda será
jcemer
8
680
Embarque App
jcemer
0
510
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
Driving AI Adoption Using In-House GPUs to Serve Qwen
po3rin
1
300
AI時代におけるプロダクト横断勉強会の設計
zozotech
PRO
0
110
人気商品が「ちゃんと買える」をつくる ー ECの負荷改善
ykagano
1
190
Does an AI Watermark Survive Translation?
machinetranslation
0
520
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3.2k
IDperturb: Enhancing Variation in Synthetic Face Generation via Angular Perturbation
sansantech
PRO
0
100
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.3k
サーバー常駐型の 簡易障害調査AI エージェントを作ってみた話
masayoshi
1
510
少人数データチームのDevin活用実践事例
runandy16
2
260
VPCでもFloatingIPを使いたいんだ
y_kotani
1
140
いま、生成AIにKaggleをどこまで 任せられるか — ROGIIコンペでの進め方とTips
k951286
1
990
AIエージェントを雇う前に決める5つのこと
knishioka
1
140
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Faster Mobile Websites
deanohume
310
32k
sira's awesome portfolio website redesign presentation
elsirapls
0
380
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
320
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
550
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