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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
630
Embarque App
jcemer
0
490
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
「使いにくい」も「運用疲れ」も卒業する UIデザイナーとエンジニアが創る持続可能な内製開発
nrinetcom
PRO
1
770
LINEヤフーにおけるAI駆動開発組織のプロデュース施策
lycorptech_jp
PRO
0
390
Eight Engineering Unit 紹介資料
sansan33
PRO
1
6.9k
開発組織の課題解決を加速するための権限委譲 -する側、される側としての向き合い方-
daitasu
3
170
Kaggleの経験が実務にどう活きているか / kaggle_findy
sansan_randd
3
380
大規模な組織におけるAI Agent活用の促進と課題
lycorptech_jp
PRO
6
7.7k
Master Dataグループ紹介資料
sansan33
PRO
1
4.4k
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
22k
メタデータ同期に潜んでいた問題 〜 Cache Stampede 時の Cycle Wait を⾒つけた話
lycorptech_jp
PRO
0
140
マルチロールEMが実践する「組織のレジリエンス」を高めるための組織構造と人材配置戦略
coconala_engineer
2
330
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
650
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
44k
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
480
Evolving SEO for Evolving Search Engines
ryanjones
0
150
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
460
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
Six Lessons from altMBA
skipperchong
29
4.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
HDC tutorial
michielstock
1
490
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
240
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
360
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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