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
0
170
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
300
Aplicações Web - um estudo sobre React
jcemer
1
200
Lapidando o Globo Play
jcemer
1
270
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
630
Embarque App
jcemer
0
490
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
150
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
240
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
200
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
450
Greatest Disaster Hits in Web Performance
guaca
0
250
配列に見る bash と zsh の違い
kazzpapa3
1
150
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
210
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
180
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
Digitization部 紹介資料
sansan33
PRO
1
6.8k
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
350
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Facilitating Awesome Meetings
lara
57
6.8k
Technical Leadership for Architectural Decision Making
baasie
1
240
Navigating Weather and Climate Data
rabernat
0
110
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
53
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
A better future with KSS
kneath
240
18k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
Rails Girls Zürich Keynote
gr2m
96
14k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
Skip the Path - Find Your Career Trail
mkilby
0
56
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
360
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