Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
なぜ使われないのか?──定量×定性で見極める本当のボトルネック
kakehashi
PRO
1
670
こがヘンだよ!Snowflake?サービス名称へのこだわり
tarotaro0129
0
110
ブラウザ拡張のセキュリティの話 / Browser Extension Security
flatt_security
0
260
AI 時代のデータ戦略
na0
8
3.2k
セキュリティAIエージェントの現在と未来 / PSS #2 Takumi Session
flatt_security
3
1.3k
Claude Code Getting Started Guide(en)
oikon48
0
130
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.3k
命名から始めるSpec Driven
kuruwic
3
820
mablでリグレッションテストをデイリー実行するまで #mablExperience
bengo4com
0
470
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
0
120
Docker, Infraestructuras seguras y Hardening
josejuansanchez
0
140
Symfony AI in Action
el_stoffel
2
350
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.7k
Speed Design
sergeychernyshev
33
1.4k
Become a Pro
speakerdeck
PRO
30
5.7k
A Tale of Four Properties
chriscoyier
162
23k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.1k
A designer walks into a library…
pauljervisheath
210
24k
RailsConf 2023
tenderlove
30
1.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Side Projects
sachag
455
43k
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