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
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
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
670
Embarque App
jcemer
0
500
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
背中から、背中へ /paying forward to community
naitosatoshi
0
180
小さいから、全部わかる。— 常駐AI "xangi" のすすめ
sugupoko
0
190
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
310
週末にループ・エンジニアリングの理解を深めるためのスライド
nagatsu
0
700
從開發到部署全都交給 AI:實作 AI 驅動的自動化流程
appleboy
0
190
AIは、人間らしい仕事の夢を見るか?─ AI時代のtoB/toEプロダクトを再設計する
techtekt
PRO
0
190
Fabricをフル活用する AI Agent Hub -製造業特化AIエージェントの設計
iotcomjpadmin
0
170
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
610
MySQL & MySQL HeatWave Report - June 2026
freshdaz
0
230
From Prompt Engineering to Loop Engineering
shibuiwilliam
1
300
Terraform 101 (初心者向け) 資料
shuadachi
0
110
作る力から、見極める力へ — AI時代に広がるエンジニアの価値と役割
rince
0
380
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
310
The Language of Interfaces
destraynor
162
27k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
850
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
New Earth Scene 8
popppiees
3
2.4k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
370
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
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