You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,10 +71,9 @@ There are two types of tracking:
71
71
72
72
If a media (website) has one single topic, it can be tracked using `UserReport.trackScreenView()`.
73
73
74
-
If a website has different sections, for instance *Health*, *World news* and *Local news*, then it should be tracked using `UserReport.trackSectionScreenView(sectionId)`. The `sectionId` for a particular section can be found on the Media Setting page in UserReport.
75
-
Even when `UserReport.trackSectionScreenView(sectionId)` is used `UserReport.trackScreenView()` should be invoked as well.
74
+
If a website has different sections, for instance *Health*, *World news* and *Local news*, then it should be tracked using both `UserReport.trackScreenView()` and `UserReport.trackSectionScreenView(sectionId)`. The `sectionId` for a particular section can be found on the Media Setting page in UserReport.
76
75
77
-
Example of manual tracking:
76
+
Example of manual screen tracking:
78
77
```swift
79
78
class ViewController: UIViewController {
80
79
override open func viewDidAppear(_ animated: Bool) {
@@ -86,6 +85,19 @@ class ViewController: UIViewController {
86
85
}
87
86
```
88
87
88
+
Example of manual section tracking:
89
+
```swift
90
+
class ViewController: UIViewController {
91
+
override open func viewDidAppear(_ animated: Bool) {
92
+
super.viewDidAppear(animated)
93
+
94
+
// Tracking section view (use both functions)
95
+
UserReport.trackScreenView()
96
+
UserReport.trackSectionScreenView(sectionId)
97
+
}
98
+
}
99
+
```
100
+
89
101
#### Do not combine automatic and manual tracking
90
102
If you use the `UserReport.trackSectionScreenView` and/or `UserReport.trackScreenView()` methods, then automatic tracking should be disabled. As you can see in the manual tracking example, the `ViewController` does *not* inherit from `UserReportViewController`.
0 commit comments