With user tracking you will be able to know how your user is behaving on the page, what he is doing, in addition to access reports and statistics by google analytics. In this talk, I will show how was the evolution of user tracking (using google analytics), since the break of Globosat Play monolith and how to track the user across multiple systems without repetitions code, centralizing all the tracking logic in one place, monitoring the events and actions in different project pages (services). It will also be addressed part of validations and tests to ensure the proper functioning of all this metrics.
=========
Com o monitoramento do usuário, você pode saber como o seu usuário está se comportando em sua página, o que ele está fazendo, além de poder gerar relatórios e estatisticas usando google analytics. Nessa palestra, eu vou mostrar a evolução do monitoramento do usuário (usando google analytics), desde a quebra do monolíto do Globosat Play e como monitorar o usuário entre os micro serviços, sem repetição de codigo, centralizando toda a logica em um unico lugar, monitorando os eventos e ações em diferentes páginas (serviços). Vou também abordar parte da validação e testes que garantem o funcionamento dessas métricas.
21. USER BEHAVIOUR
WHAT
▸ Connect with WHO
▸ Know what your user is doing
▸ By individual
▸ By demographic
▸ By a delimiter
▸ Engagement
▸ Ways people use your app
22. USER BEHAVIOUR
WHERE
▸ Where does your user most utilize your app ?
▸ Location - What state/cities is your app most popular
▸ Devices - What is the most popular device
▸ Focus marketing/advertising efforts
23. USER BEHAVIOUR
WHEN
▸ When is your user in your app
▸ Track time, dates, season, moments
▸ Release upgrades in low-impact moments
▸ Focus marketing/advertising efforts
24. USER BEHAVIOUR
WHY
▸ Subjective to each app/goal
▸ Results
▸ Track targeted objectives with goals
▸ Align app goals with user action’s
43. GOOGLE ANALYTICS WORKFLOW
Users
Visits / Sessions
Pageviews
__utma - Visitor Identifier (expires after 2 years)
__utmb - Session Identifier
(expires after 30 minutes of inactivity)
__utmc - Session Identifier
(expires when close tab/browser)
44. GOOGLE ANALYTICS WORKFLOW
Users __utma cookie explained:
123456789.123456789.1234567890.1234567890.1234567980.1
Domain Hash: This is set by all cookies from this domain.
Visitor ID: Random “unique ID”.
Initial visit: Unix timestamp for the initial visit.
Previous Session: Unix timestamp for the previous session.
Current Session: Unix timestamp for the current session.
Session number: Number of the session
83. micro services - apis, components, libs, small applications
CASE
mini iceberg monolith
84. HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
LIVE TRANSMISSIONS
HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
RELATED PROGRAMS
Components
APIs
Home APP
Live Video APP
85. HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
LIVE TRANSMISSIONS
HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
LIVE TRANSMISSIONS
86. HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
LIVE TRANSMISSIONS
92. `CASECASE
USER TRACKER JS
▸ Lib that monitor all user activity and trigger javascript events.
▸ Single and Simple Deployment
▸ Run independent of application JS
▸ Easy to test
▸ Easy to change
USER TRACKER JS
93. USER TRACKER JS
HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
LIVE TRANSMISSIONS
HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
RELATED PROGRAMS
98. USER TRACKER JS
bind js events
ANY CUSTOM JS
$(‘body’).on(“user_tracker::login::pop_open”, function(){
// Google Analytics push event
// Do some task
// Open the window
});
102. GA POWER JS
CASECASE
GA POWER JS
▸ Run independent from the page
▸ Centralizes all interaction with google analytics
▸ Single and Simple Deployment
▸ Easy to test
▸ Easy to change
103. USER TRACKER JS
HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
LIVE TRANSMISSIONS
HEADER ( HOME | MENUS | LOGIN )
FOOTER ( HOME | MENUS )
RELATED PROGRAMS
GA POWER JS
bind js events
106. CASECASE
GA POWER JS
GA POWER JS :: TESTS
▸ Jasmine Unit Tests
▸ Smoke tests for QA and PROD environment
▸ Fake Analytics (More on next slide)
107. https://github.com/rafaelbiriba/analytics-tester
Test suite for Google Analytics that replaces the original ga.js
and provide some useful methods for testing purposes.
** Only supports _gaq (old analytics)
Pull request for the new ga code are welcome :)
FAKE ANALYTICS
108. https://github.com/rafaelbiriba/analytics-tester
Just replace the include of http://www.google-analytics.com/ga.js
to include the fake ga.js
Any _gaq.push will be stored in a array inside fake ga.
You can access the array and test (with selenium for exemple) if
the google command "was called”.
FAKE ANALYTICS :: HOW TO USE