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
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
130
侵入は突然に 〜 IoTマルウェアと悪用される家庭の機器 ~ / When Intrusion Strikes: IoT Malware and the Abuse of Home Devices
nttcom
0
1.6k
Digitization部 紹介資料
sansan33
PRO
2
7.7k
QAエンジニア起点で進める、SmartHRにおける信頼性向上について
kaomi_wombat
1
120
取引先から届く 「セキュリティチェックシート」の読み解き方
kamadamakoto
0
140
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
220
モバイルアプリ開発概論2026
recruitengineers
PRO
5
510
システム思考で問題に対処する
yussak
0
210
【CEDEC2026】グラフィックスエンジニアのためのニューラルシェーディング入門
cygames
PRO
0
130
SO-101×VLAによる3色キューブのピック&プレース
abeja
0
160
AI時代の強いチームの作り方
yuukiyo
26
16k
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
1
10k
Marketing to machines
jonoalderson
1
5.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
The Cult of Friendly URLs
andyhume
79
7k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
630
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
Designing for Timeless Needs
cassininazir
1
430
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
230
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Google's AI Overviews - The New Search
badams
0
1.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
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