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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
200
Cache em aplicações web
jcemer
0
330
Aplicações Web - um estudo sobre React
jcemer
1
210
Lapidando o Globo Play
jcemer
1
280
Desenvolvedor mobile precisa aprender Web
jcemer
1
140
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
630
Tudo o que a web (podia ser) ainda será
jcemer
8
660
Embarque App
jcemer
0
500
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
DevOps Agentで始めるAWS運用 〜フロンティアエージェントが変える運用の現場〜
nyankotaro
1
320
Rubyで音を視る
ydah
1
110
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
0
210
新アーキテクチャ「TiDB X」解説とDedicated比較 TiDB Cloud Premiumのゲーム運用活用を検証
staffrecruiter
0
120
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
1.2k
トークン数だけでは測れない — Claude Code 組織展開の効果検証から学んだこと
makikub
0
140
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
2
260
【Gen-AX】20260530開催_JJUG CCC 2026 Spring
genax
0
440
新規ゲーム開発におけるAI駆動開発のリアル
202409e2
0
2.9k
AI Testing Talks: Challenges of Applying AI in Software Testing: From Hype to Practical Use
exactpro
PRO
1
140
「嘘をつくテスト」の失敗例から学ぶ 良いテストコード #frontend_phpcon_do
asumikam
0
570
protovalidate-es を導入してみた
bengo4com
0
150
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
380
Prompt Engineering for Job Search
mfonobong
0
330
Rails Girls Zürich Keynote
gr2m
96
14k
What's in a price? How to price your products and services
michaelherold
247
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
190
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Marketing to machines
jonoalderson
1
5.4k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
320
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
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