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
Jean Carlo Emer
October 27, 2016
Technology
0
160
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
290
Aplicações Web - um estudo sobre React
jcemer
1
190
Lapidando o Globo Play
jcemer
1
260
Desenvolvedor mobile precisa aprender Web
jcemer
1
110
Evolução e futuro do uso de paradigmas no JavaScript
jcemer
3
610
Tudo o que a web (podia ser) ainda será
jcemer
8
620
Embarque App
jcemer
0
480
Componentes para a web
jcemer
15
1.2k
Other Decks in Technology
See All in Technology
開発者から見たLLMの進化 202511
ny7760
1
170
嗚呼、当時の本番環境の状態で AI Agentを再評価したいなぁ...
po3rin
0
400
ubuntu-latest から ubuntu-slim へ移行しよう!コスト削減うれしい~!
asumikam
0
460
コミュニティと共に変化する 私とFusicの8年間
ayasamind
0
450
Introducing RFC9111 / YAPC::Fukuoka 2025
k1low
1
210
ユーザーストーリー x AI / User Stories x AI
oomatomo
0
170
ある編集者のこれまでとこれから —— 開発者コミュニティと歩んだ四半世紀
inao
1
280
どうなる Remix 3
tanakahisateru
2
350
Flutter DevToolsで発見! 本番アプリのパフォーマンス問題と改善の実践
goto_tsl
1
340
こんな時代だからこそ! 想定しておきたいアクセスキー漏洩後のムーブ
takuyay0ne
4
530
Copilotの精度を上げる!カスタムプロンプト入門.pdf
ismk
10
3.3k
ソフトウェアエンジニアとデータエンジニアの違い・キャリアチェンジ
mtpooh
1
740
Featured
See All Featured
Building Adaptive Systems
keathley
44
2.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Thoughts on Productivity
jonyablonski
73
4.9k
Why Our Code Smells
bkeepers
PRO
340
57k
Scaling GitHub
holman
463
140k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
The Language of Interfaces
destraynor
162
25k
Side Projects
sachag
455
43k
Unsuck your backbone
ammeep
671
58k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Producing Creativity
orderedlist
PRO
348
40k
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