Skip to content

Commit ac6ada6

Browse files
ethanneffsatya164
andauthored
Update screen-tracking docs to include initial route (#1373)
Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
1 parent c0d2387 commit ac6ada6

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

versioned_docs/version-6.x/screen-tracking.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default () => {
3232
ref={navigationRef}
3333
onReady={() => {
3434
routeNameRef.current = navigationRef.getCurrentRoute().name;
35+
36+
// Replace the line below to add the tracker from a mobile analytics SDK
37+
await trackScreenView(routeNameRef.current);
3538
}}
3639
onStateChange={async () => {
3740
const previousRouteName = routeNameRef.current;

versioned_docs/version-7.x/screen-tracking.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ export default function App() {
149149
ref={navigationRef}
150150
onReady={() => {
151151
routeNameRef.current = navigationRef.current.getCurrentRoute().name;
152+
153+
// Replace the line below to add the tracker from a mobile analytics SDK
154+
await trackScreenView(routeNameRef.current);
152155
}}
153156
onStateChange={async () => {
154157
const previousRouteName = routeNameRef.current;

versioned_docs/version-8.x/screen-tracking.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ export default function App() {
149149
ref={navigationRef}
150150
onReady={() => {
151151
routeNameRef.current = navigationRef.current.getCurrentRoute().name;
152+
153+
// Replace the line below to add the tracker from a mobile analytics SDK
154+
await trackScreenView(routeNameRef.current);
152155
}}
153156
onStateChange={async () => {
154157
const previousRouteName = routeNameRef.current;

0 commit comments

Comments
 (0)