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
210
Cache em aplicações web
jcemer
0
340
Aplicações Web - um estudo sobre React
jcemer
1
220
Lapidando o Globo Play
jcemer
1
280
Desenvolvedor mobile precisa aprender Web
jcemer
1
150
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
630
Tudo o que a web (podia ser) ainda será
jcemer
8
680
Embarque App
jcemer
0
500
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
モノリス Rails でも日中に rails db:migrate を走らせたい! / Daytime rails db:migrate on Monolithic Rails!
euglena1215
4
550
JavaScript 研修 (2026)
recruitengineers
PRO
2
470
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
210
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
190
老害フォレンジッカーはAI羊の夢を見るか?
tadmaddad
0
310
AI駆動開発は個人技からチーム戦へ:組織でAIを使いこなすための実践設計
moongift
PRO
0
480
オートロックマンションなのに、各部屋は施錠なし!? 攻撃者が組織内ネットワークで大暴れする理由 / The Front Door Is Locked, but the Rooms Are Wide Open: Why Attackers Move Freely Inside Enterprise Networks
nttcom
1
1.6k
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
100
ガバメントクラウドでのランサムウェア対策
techniczna
2
1k
GitHub CopilotのFinOps- AI CreditのObservabilityと価値を生むためのエージェント設計
yuriemori
0
150
新しい SLO が良い感じにハマっている話
z63d
5
2.2k
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
520
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
790
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
640
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Writing Fast Ruby
sferik
630
63k
Making Projects Easy
brettharned
120
6.7k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Abbi's Birthday
coloredviolet
3
9.3k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
410
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