Skip to content

Commit 89311ba

Browse files
Clarify that section tracking requires two calls
1 parent 8d1e0d0 commit 89311ba

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ There are two types of tracking:
7171
7272
If a media (website) has one single topic, it can be tracked using `UserReport.trackScreenView()`.
7373
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.
7675
77-
Example of manual tracking:
76+
Example of manual screen tracking:
7877
```swift
7978
class ViewController: UIViewController {
8079
override open func viewDidAppear(_ animated: Bool) {
@@ -86,6 +85,19 @@ class ViewController: UIViewController {
8685
}
8786
```
8887
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+
89101
#### Do not combine automatic and manual tracking
90102
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`.
91103

0 commit comments

Comments
 (0)