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
0
180
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
310
Aplicações Web - um estudo sobre React
jcemer
1
200
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
640
Embarque App
jcemer
0
490
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
実践 Datadog MCP Server
nulabinc
PRO
2
200
情シスのための生成AI実践ガイド2026 / Generative AI Practical Guide for Business Technology 2026
glidenote
0
250
堅牢.py#2 LT資料
t3tra
0
150
楽しく学ぼう!ネットワーク入門
shotashiratori
1
370
JAWSDAYS2026_A-6_現場SEが語る 回せるセキュリティ運用~設計で可視化、AIで加速する「楽に回る」運用設計のコツ~
shoki_hata
0
3k
【Oracle Cloud ウェビナー】【入門編】はじめてのOracle AI Data Platform - AIのためのデータ準備&自社用AIエージェントをワンストップで実現
oracle4engineer
PRO
1
110
Claude Codeが爆速進化してプラグイン追従がつらいので半自動化した話 ver.2
rfdnxbro
0
540
OCI技術資料 : コンピュート・サービス 概要
ocise
4
54k
複数クラスタ運用と検索の高度化:ビズリーチにおけるElastic活用事例 / ElasticON Tokyo2026
visional_engineering_and_design
0
160
脳内メモリ、思ったより揮発性だった
koutorino
0
360
スクリプトの先へ!AIエージェントと組み合わせる モバイルE2Eテスト
error96num
0
180
Claude Code Skills 勉強会 (DevelersIO向けに調整済み) / claude code skills for devio
masahirokawahara
1
21k
Featured
See All Featured
How to make the Groovebox
asonas
2
2k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
270
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Mobile First: as difficult as doing things right
swwweet
225
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Building Applications with DynamoDB
mza
96
7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
Accessibility Awareness
sabderemane
0
80
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Rails Girls Zürich Keynote
gr2m
96
14k
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