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
Set the`trackNode` for the Activity/Fragment/View to add tracking parameters.
41
+
Set a`trackNode` for the Activity/Fragment/View to add tracking parameters.
62
42
63
43
```kotlin
64
44
trackNode =TrackNode("channel_name" to "recommend")
@@ -68,63 +48,32 @@ trackNode = TrackNode("channel_name" to "recommend")
68
48
holder.itemView.trackNode =TrackNode("video_id" to item.id, "video_type" to item.type)
69
49
```
70
50
71
-
#### Establish a page source responsibility chain
72
-
73
-
When starting an activity, you need to call `intent.putReferrerTrackNode(activity/fragment/view)` to set the source node.
51
+
Set a referrer node and a page node to establish a chain of source responsibilities between activity.
74
52
75
53
```kotlin
76
54
val intent =Intent(activity, DetailsActivity::class.java).putReferrerTrackNode(view)
77
55
activity.startActivity(intent)
78
56
```
79
57
80
-
Then set a `PageTrackNode` in the the activity to establish a chain of source responsibilities between activity.
81
-
82
58
```kotlin
83
-
trackNode =PageTrackNode("page_name" to "details")
59
+
activity.trackNode =PageTrackNode("page_name" to "details")
84
60
```
85
61
86
-
`PageTrackNode` will add the parameters of all the previous nodes to the page node, and some conversion rules can be set when adding. For example, the 'page_name' of the previous page, after jumping, report 'from_page'.
62
+
This creates a chain of responsibility similar to the one below.
87
63
88
-
```kotlin
89
-
val referrerKeyMap =mapOf("page_name" to "from_page", "channel_name" to "from_channel_name")
90
-
trackNode =PageTrackNode(referrerKeyMap, "page_name" to "details")
0 commit comments