SlideShare a Scribd company logo
Thinking
metrics on

React apps@jcemer
I work on
GloboPlay.

globo.com
Thinking metrics on React apps
Thinking metrics on React apps
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

More Related Content

PDF
Session 3 android study jam
PDF
Testing Two-Way Data Binding in AngularJS
PDF
GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...
PPTX
Getting started with react &amp; redux
PDF
Session 2 android study jam
PDF
React: High level overview for backend developers
PPT
Mobile based Health Care System Architecture using Android OS
PPTX
Using Event Tracking to Enhance Library Web Interfaces
Session 3 android study jam
Testing Two-Way Data Binding in AngularJS
GAB 2019 - Integrate Microsoft Graph​ with Azure Active Directory​ in your cl...
Getting started with react &amp; redux
Session 2 android study jam
React: High level overview for backend developers
Mobile based Health Care System Architecture using Android OS
Using Event Tracking to Enhance Library Web Interfaces

What's hot (9)

PDF
What 100M downloads taught us about iOS architectures
PDF
ヌガー対応 Potatotios #33
PDF
Chapter obtaining information_about_features
PDF
Angular.js - An introduction for the unitiated
PDF
Unidirectional Data Flow in Swift
PDF
PPTX
Using Redux with Polymer
PDF
Component-based Front-End architecture
PPT
Tools Of The Geospatial Web
What 100M downloads taught us about iOS architectures
ヌガー対応 Potatotios #33
Chapter obtaining information_about_features
Angular.js - An introduction for the unitiated
Unidirectional Data Flow in Swift
Using Redux with Polymer
Component-based Front-End architecture
Tools Of The Geospatial Web
Ad

Similar to Thinking metrics on React apps (20)

PDF
Introducing Rendr: Run your Backbone.js apps on the client and server
PDF
A Blog About Using State in Next.js: Valuable Insights
PDF
AnDevCon - Tracking User Behavior Creatively
PPTX
Big Data for each one of us
PDF
Angular resolver tutorial
PPTX
Android app performance
PPTX
Android apps development
PPTX
Damian Kmiecik - Road trip with Redux
PPTX
A Single activity app with Jetpack's Navigation Component
PDF
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
PDF
Fragments: Why, How, What For?
PDF
Materi Modern React Redux Power Point.pdf
PPTX
Battle of React State Managers in frontend applications
PPTX
UIF(UI Frame work)Notes MRUH_UNIT 2.pptx
PPTX
Asp.Net Mvc
PDF
Windows phone 7 series
PPTX
Intro react js
PPTX
ATAGTR2017 HikeRunner: Load Test Framework
PDF
Server side rendering with React and Symfony
PDF
React Redux AntD and Umi js
Introducing Rendr: Run your Backbone.js apps on the client and server
A Blog About Using State in Next.js: Valuable Insights
AnDevCon - Tracking User Behavior Creatively
Big Data for each one of us
Angular resolver tutorial
Android app performance
Android apps development
Damian Kmiecik - Road trip with Redux
A Single activity app with Jetpack's Navigation Component
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
Fragments: Why, How, What For?
Materi Modern React Redux Power Point.pdf
Battle of React State Managers in frontend applications
UIF(UI Frame work)Notes MRUH_UNIT 2.pptx
Asp.Net Mvc
Windows phone 7 series
Intro react js
ATAGTR2017 HikeRunner: Load Test Framework
Server side rendering with React and Symfony
React Redux AntD and Umi js
Ad

Recently uploaded (20)

PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
project resource management chapter-09.pdf
PDF
August Patch Tuesday
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPT
What is a Computer? Input Devices /output devices
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Enhancing emotion recognition model for a student engagement use case through...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
1 - Historical Antecedents, Social Consideration.pdf
project resource management chapter-09.pdf
August Patch Tuesday
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Final SEM Unit 1 for mit wpu at pune .pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
Module 1.ppt Iot fundamentals and Architecture
gpt5_lecture_notes_comprehensive_20250812015547.pdf
cloud_computing_Infrastucture_as_cloud_p
O2C Customer Invoices to Receipt V15A.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A novel scalable deep ensemble learning framework for big data classification...
OMC Textile Division Presentation 2021.pptx
Chapter 5: Probability Theory and Statistics
A comparative study of natural language inference in Swahili using monolingua...
What is a Computer? Input Devices /output devices

Thinking metrics on React apps