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
130
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
160
Cache em aplicações web
jcemer
0
270
Aplicações Web - um estudo sobre React
jcemer
1
170
Lapidando o Globo Play
jcemer
1
230
Desenvolvedor mobile precisa aprender Web
jcemer
1
94
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
590
Tudo o que a web (podia ser) ainda será
jcemer
8
570
Embarque App
jcemer
0
460
Componentes para a web
jcemer
15
1.1k
Other Decks in Technology
See All in Technology
OpenID BizDay#17 KYC WG活動報告(法人) / 20250219-BizDay17-KYC-legalidentity
oidfj
0
250
分解して理解する Aspire
nenonaninu
1
180
データの品質が低いと何が困るのか
kzykmyzw
6
1.1k
The Future of SEO: The Impact of AI on Search
badams
0
200
次世代KYC活動報告 / 20250219-BizDay17-KYC-nextgen
oidfj
0
260
開発組織のための セキュアコーディング研修の始め方
flatt_security
3
2.4k
Tech Blogを書きやすい環境づくり
lycorptech_jp
PRO
1
240
Data-centric AI入門第6章:Data-centric AIの実践例
x_ttyszk
1
410
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.4k
2/18/25: Java meets AI: Build LLM-Powered Apps with LangChain4j
edeandrea
PRO
0
120
転生CISOサバイバル・ガイド / CISO Career Transition Survival Guide
kanny
3
1k
PHPカンファレンス名古屋-テックリードの経験から学んだ設計の教訓
hayatokudou
2
320
Featured
See All Featured
Six Lessons from altMBA
skipperchong
27
3.6k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Practical Orchestrator
shlominoach
186
10k
Speed Design
sergeychernyshev
27
790
A better future with KSS
kneath
238
17k
It's Worth the Effort
3n
184
28k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
A Tale of Four Properties
chriscoyier
158
23k
Agile that works and the tools we love
rasmusluckow
328
21k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Bash Introduction
62gerente
611
210k
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