This example shows how to do screen tracking and send to Google Analytics. The approach can be adapted to any other analytics SDK.
When using built-in navigation container, we can use
onNavigationStateChange to track the screen.
Screen tracking with Redux
When using Redux, we can write a Redux middleware to track the screen. For this purpose,
we will reuse
getCurrentRouteName from the previous section.
Create Redux store and apply the above middleware
screenTracking middleware can be applied to the store during its creation. See Redux Integration for details.