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
180
0
Share
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
200
Cache em aplicações web
jcemer
0
320
Aplicações Web - um estudo sobre React
jcemer
1
210
Lapidando o Globo Play
jcemer
1
270
Desenvolvedor mobile precisa aprender Web
jcemer
1
130
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
620
Tudo o que a web (podia ser) ainda será
jcemer
8
650
Embarque App
jcemer
0
490
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
Blue/Green Deployment を用いた PostgreSQL のメジャーバージョンアップ
kkato1
1
210
OCI技術資料 : ロード・バランサ 概要 - FLB・NLB共通
ocise
4
27k
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
77k
Zephyr(RTOS)でOpenPLCを実装してみた
iotengineer22
0
180
TUNA Camp 2026 京都Stage ヒューリスティックアルゴリズム入門
terryu16
0
650
MIX AUDIO EN BROADCAST
ralpherick
0
140
GitHub Actions侵害 — 相次ぐ事例を振り返り、次なる脅威に備える
flatt_security
12
7.3k
「活動」は激変する。「ベース」は変わらない ~ 4つの軸で捉える_AI時代ソフトウェア開発マネジメント
sentokun
0
140
Kiro Meetup #7 Kiro アップデート (2025/12/15〜2026/3/20)
katzueno
2
280
脳が溶けた話 / Melted Brain
keisuke69
1
1.2k
Babylon.js Japan Activities (2026/4)
limes2018
0
140
OCI技術資料 : 証明書サービス概要
ocise
1
7.2k
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
500
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
The Invisible Side of Design
smashingmag
302
51k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
Testing 201, or: Great Expectations
jmmastey
46
8.1k
We Are The Robots
honzajavorek
0
210
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Tell your own story through comics
letsgokoyo
1
880
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
250
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
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