@schibsted/pulse-sdk 8.0.0-rc.13 → 8.0.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tracker.js +40 -0
- package/dist/cjs/leaveTrackingTpaas/index.js +18 -6
- package/dist/cjs/tpaas-builders/builders/device.js +1 -1
- package/dist/cjs/tpaas-builders/builders/trackerBuilder.js +2 -1
- package/dist/cjs/tpaas-builders/builders.js +18 -6
- package/dist/cjs/tpaas-schemas/constants.js +75 -51
- package/dist/cjs/tracker-proxy/consts.js +3 -0
- package/dist/cjs/version.js +1 -1
- package/dist/ejs/Tracker.js +41 -1
- package/dist/ejs/leaveTrackingTpaas/index.js +18 -6
- package/dist/ejs/tpaas-builders/builders/device.js +1 -1
- package/dist/ejs/tpaas-builders/builders/trackerBuilder.js +2 -1
- package/dist/ejs/tpaas-builders/builders.js +16 -7
- package/dist/ejs/tpaas-schemas/constants.js +73 -49
- package/dist/ejs/tracker-proxy/consts.js +3 -0
- package/dist/ejs/version.js +1 -1
- package/dist/types/Tracker.d.ts +16 -1
- package/dist/types/builders/consents.d.ts +2 -2
- package/dist/types/builders/device-node.d.ts +2 -2
- package/dist/types/builders/events-anonymous-node.d.ts +4 -4
- package/dist/types/builders/events-node.d.ts +5 -5
- package/dist/types/builders/objects/objects-anonymous-node.d.ts +1 -1
- package/dist/types/builders/objects/objects-node.d.ts +1 -1
- package/dist/types/builders/origin-node.d.ts +1 -1
- package/dist/types/cis-sync/storage/pulseStorage.d.ts +8 -4
- package/dist/types/config.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/device.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/experiments.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/navigationType.d.ts +2 -2
- package/dist/types/tpaas-builders/builders/pageviewId.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/trackerBuilder.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/user.d.ts +1 -1
- package/dist/types/tpaas-builders/builders.d.ts +43 -39
- package/dist/types/tpaas-builders/index.d.ts +1 -1
- package/dist/types/tpaas-builders/types.d.ts +2 -0
- package/dist/types/tpaas-schemas/constants.d.ts +196 -174
- package/dist/types/tpaas-schemas/types/ITpaasEvent.d.ts +6 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAffiliate.d.ts +138 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAudio.d.ts +0 -6
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTeaser.d.ts +9 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTvModule.d.ts +130 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementUIElement.d.ts +4 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementVideo.d.ts +1 -7
- package/dist/types/tpaas-schemas/types/schemas/IImpressionAffiliate.d.ts +136 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionForm.d.ts +2 -2
- package/dist/types/tpaas-schemas/types/schemas/IImpressionTeaser.d.ts +9 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveFrontpage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveListing.d.ts +10 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewFrontpage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewListing.d.ts +10 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/index.d.ts +3 -0
- package/dist/types/tpaas-schemas/types/templates/IDevice.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/templates/IPageRef.d.ts +3 -1
- package/dist/types/tpaas-schemas/types/templates/IProvider.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/templates/ITracker.d.ts +4 -0
- package/dist/types/tpaas-schemas/types/templates/IUtmTags.d.ts +0 -2
- package/dist/types/tpaas-schemas/types.d.ts +3 -3
- package/dist/types/tracker-proxy/consts.d.ts +2 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wrapper/types/event.d.ts +1 -1
- package/package.json +8 -7
|
@@ -1,336 +1,357 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.CATALOG_VERSION = exports.UTM_MEDIUM_VALUES = exports.REGION_VALUES = exports.TRACKER_TYPE_VALUES = exports.USER_THEME_VALUES = exports.SPORT_VIEW_VALUES = exports.SPORT_SUBVIEW_VALUES = exports.SPORT_EVENT_STATUS_VALUES = exports.SPORT_EVENT_COVERAGE_VALUES = exports.STAGE_VALUES = exports.PRIMARY_AXIS_VALUES = exports.FOLD_POSITION_VALUES = exports.COLUMN_NAME_VALUES = exports.PAGE_TYPE_VALUES = exports.PHYSICAL_ACTIVITY_TYPE_VALUES = exports.UNIT_TYPE_VALUES = exports.FOOD_TYPE_VALUES = exports.ACTION_VALUES = exports.VIEWPORT_SIZE_VALUES = exports.SCREEN_ORIENTATION_VALUES = exports.OPERATING_SYSTEM_VALUES = exports.DEVICE_TYPE_VALUES = exports.CLIENT_TYPE_VALUES = exports.FORMAT_SUBTYPE_VALUES = exports.FORMAT_VALUES = exports.ACCESS_LEVEL_VALUES = exports.PERSONALIZATION_VALUES = void 0;
|
|
3
|
+
exports.ViewWeather = exports.ViewVideoPage = exports.ViewTitle = exports.ViewSportsPage = exports.ViewPage = exports.ViewLockedVideoPage = exports.ViewLockedAudioPage = exports.ViewLockedArticle = exports.ViewListing = exports.ViewLandingpage = exports.ViewHealthPage = exports.ViewFrontpage = exports.ViewError = exports.ViewAudioPage = exports.ViewArticle = exports.LeaveWeather = exports.LeaveVideoPage = exports.LeaveSportsPage = exports.LeavePage = exports.LeaveLockedVideoPage = exports.LeaveLockedAudioPage = exports.LeaveLockedArticle = exports.LeaveListing = exports.LeaveLandingpage = exports.LeaveFrontpage = exports.LeaveError = exports.LeaveAudioPage = exports.LeaveArticle = exports.ImpressionWidget = exports.ImpressionUIElement = exports.ImpressionTeaser = exports.ImpressionPlayer = exports.ImpressionOffer = exports.ImpressionHealthUIElement = exports.ImpressionForm = exports.ImpressionAffiliate = exports.ImpressionAdSlot = exports.EngagementWidget = exports.EngagementVideoAd = exports.EngagementVideo = exports.EngagementUIElement = exports.EngagementTvModule = exports.EngagementTeaser = exports.EngagementOffer = exports.EngagementHealthUIElement = exports.EngagementForm = exports.EngagementAudio = exports.EngagementAffiliate = exports.CompletedHealthAction = exports.AnonymousViewUIElement = void 0;
|
|
4
|
+
exports.CATALOG_VERSION = exports.UTM_MEDIUM_VALUES = exports.REGION_VALUES = exports.TRACKER_TYPE_VALUES = exports.ROUTING_STAGE_VALUES = exports.USER_THEME_VALUES = exports.SPORT_VIEW_VALUES = exports.SPORT_SUBVIEW_VALUES = exports.SPORT_EVENT_STATUS_VALUES = exports.SPORT_EVENT_COVERAGE_VALUES = exports.STAGE_VALUES = exports.PRIMARY_AXIS_VALUES = exports.FOLD_POSITION_VALUES = exports.COLUMN_NAME_VALUES = exports.PAGE_TYPE_VALUES = exports.PHYSICAL_ACTIVITY_TYPE_VALUES = exports.UNIT_TYPE_VALUES = exports.FOOD_TYPE_VALUES = exports.ACTION_VALUES = exports.VIEWPORT_SIZE_VALUES = exports.SCREEN_ORIENTATION_VALUES = exports.OPERATING_SYSTEM_VALUES = exports.DEVICE_TYPE_VALUES = exports.CLIENT_TYPE_VALUES = exports.FORMAT_SUBTYPE_VALUES = exports.FORMAT_VALUES = exports.ACCESS_LEVEL_VALUES = exports.PERSONALIZATION_VALUES = exports.MARKETING_VALUES = exports.ANALYTICS_VALUES = exports.ADVERTISING_VALUES = void 0;
|
|
5
5
|
exports.AnonymousViewUIElement = {
|
|
6
6
|
eventType: 'AnonymousView',
|
|
7
7
|
isAnonymous: true,
|
|
8
8
|
object: {
|
|
9
9
|
objectType: 'UIElement',
|
|
10
10
|
},
|
|
11
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
11
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/AnonymousViewUIElement.json',
|
|
12
12
|
};
|
|
13
13
|
exports.CompletedHealthAction = {
|
|
14
14
|
eventType: 'Completed',
|
|
15
15
|
object: {
|
|
16
16
|
objectType: 'HealthAction',
|
|
17
17
|
},
|
|
18
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
18
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/CompletedHealthAction.json',
|
|
19
|
+
};
|
|
20
|
+
exports.EngagementAffiliate = {
|
|
21
|
+
eventType: 'Engagement',
|
|
22
|
+
object: {
|
|
23
|
+
objectType: 'Affiliate',
|
|
24
|
+
},
|
|
25
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementAffiliate.json',
|
|
19
26
|
};
|
|
20
27
|
exports.EngagementAudio = {
|
|
21
28
|
eventType: 'Engagement',
|
|
22
29
|
object: {
|
|
23
30
|
objectType: 'Audio',
|
|
24
31
|
},
|
|
25
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
32
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementAudio.json',
|
|
26
33
|
};
|
|
27
34
|
exports.EngagementForm = {
|
|
28
35
|
eventType: 'Engagement',
|
|
29
36
|
object: {
|
|
30
37
|
objectType: 'Form',
|
|
31
38
|
},
|
|
32
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
39
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementForm.json',
|
|
33
40
|
};
|
|
34
41
|
exports.EngagementHealthUIElement = {
|
|
35
42
|
eventType: 'Engagement',
|
|
36
43
|
object: {
|
|
37
44
|
objectType: 'HealthUIElement',
|
|
38
45
|
},
|
|
39
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
46
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementHealthUIElement.json',
|
|
40
47
|
};
|
|
41
48
|
exports.EngagementOffer = {
|
|
42
49
|
eventType: 'Engagement',
|
|
43
50
|
object: {
|
|
44
51
|
objectType: 'Offer',
|
|
45
52
|
},
|
|
46
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
53
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementOffer.json',
|
|
47
54
|
};
|
|
48
55
|
exports.EngagementTeaser = {
|
|
49
56
|
eventType: 'Engagement',
|
|
50
57
|
object: {
|
|
51
58
|
objectType: 'Teaser',
|
|
52
59
|
},
|
|
53
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
60
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementTeaser.json',
|
|
61
|
+
};
|
|
62
|
+
exports.EngagementTvModule = {
|
|
63
|
+
eventType: 'Engagement',
|
|
64
|
+
object: {
|
|
65
|
+
objectType: 'TvModule',
|
|
66
|
+
},
|
|
67
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementTvModule.json',
|
|
54
68
|
};
|
|
55
69
|
exports.EngagementUIElement = {
|
|
56
70
|
eventType: 'Engagement',
|
|
57
71
|
object: {
|
|
58
72
|
objectType: 'UIElement',
|
|
59
73
|
},
|
|
60
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
74
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementUIElement.json',
|
|
61
75
|
};
|
|
62
76
|
exports.EngagementVideo = {
|
|
63
77
|
eventType: 'Engagement',
|
|
64
78
|
object: {
|
|
65
79
|
objectType: 'Video',
|
|
66
80
|
},
|
|
67
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
81
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementVideo.json',
|
|
68
82
|
};
|
|
69
83
|
exports.EngagementVideoAd = {
|
|
70
84
|
eventType: 'Engagement',
|
|
71
85
|
object: {
|
|
72
86
|
objectType: 'VideoAd',
|
|
73
87
|
},
|
|
74
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
88
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementVideoAd.json',
|
|
75
89
|
};
|
|
76
90
|
exports.EngagementWidget = {
|
|
77
91
|
eventType: 'Engagement',
|
|
78
92
|
object: {
|
|
79
93
|
objectType: 'Widget',
|
|
80
94
|
},
|
|
81
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
95
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/EngagementWidget.json',
|
|
82
96
|
};
|
|
83
97
|
exports.ImpressionAdSlot = {
|
|
84
98
|
eventType: 'Impression',
|
|
85
99
|
object: {
|
|
86
100
|
objectType: 'AdSlot',
|
|
87
101
|
},
|
|
88
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
102
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionAdSlot.json',
|
|
103
|
+
};
|
|
104
|
+
exports.ImpressionAffiliate = {
|
|
105
|
+
eventType: 'Impression',
|
|
106
|
+
object: {
|
|
107
|
+
objectType: 'Affiliate',
|
|
108
|
+
},
|
|
109
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionAffiliate.json',
|
|
89
110
|
};
|
|
90
111
|
exports.ImpressionForm = {
|
|
91
112
|
eventType: 'Impression',
|
|
92
113
|
object: {
|
|
93
114
|
objectType: 'Form',
|
|
94
115
|
},
|
|
95
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
116
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionForm.json',
|
|
96
117
|
};
|
|
97
118
|
exports.ImpressionHealthUIElement = {
|
|
98
119
|
eventType: 'Impression',
|
|
99
120
|
object: {
|
|
100
121
|
objectType: 'HealthUIElement',
|
|
101
122
|
},
|
|
102
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
123
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionHealthUIElement.json',
|
|
103
124
|
};
|
|
104
125
|
exports.ImpressionOffer = {
|
|
105
126
|
eventType: 'Impression',
|
|
106
127
|
object: {
|
|
107
128
|
objectType: 'Offer',
|
|
108
129
|
},
|
|
109
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
130
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionOffer.json',
|
|
110
131
|
};
|
|
111
132
|
exports.ImpressionPlayer = {
|
|
112
133
|
eventType: 'Impression',
|
|
113
134
|
object: {
|
|
114
135
|
objectType: 'Player',
|
|
115
136
|
},
|
|
116
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
137
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionPlayer.json',
|
|
117
138
|
};
|
|
118
139
|
exports.ImpressionTeaser = {
|
|
119
140
|
eventType: 'Impression',
|
|
120
141
|
object: {
|
|
121
142
|
objectType: 'Teaser',
|
|
122
143
|
},
|
|
123
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
144
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionTeaser.json',
|
|
124
145
|
};
|
|
125
146
|
exports.ImpressionUIElement = {
|
|
126
147
|
eventType: 'Impression',
|
|
127
148
|
object: {
|
|
128
149
|
objectType: 'UIElement',
|
|
129
150
|
},
|
|
130
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
151
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionUIElement.json',
|
|
131
152
|
};
|
|
132
153
|
exports.ImpressionWidget = {
|
|
133
154
|
eventType: 'Impression',
|
|
134
155
|
object: {
|
|
135
156
|
objectType: 'Widget',
|
|
136
157
|
},
|
|
137
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
158
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ImpressionWidget.json',
|
|
138
159
|
};
|
|
139
160
|
exports.LeaveArticle = {
|
|
140
161
|
eventType: 'Leave',
|
|
141
162
|
object: {
|
|
142
163
|
objectType: 'Article',
|
|
143
164
|
},
|
|
144
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
165
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveArticle.json',
|
|
145
166
|
};
|
|
146
167
|
exports.LeaveAudioPage = {
|
|
147
168
|
eventType: 'Leave',
|
|
148
169
|
object: {
|
|
149
170
|
objectType: 'AudioPage',
|
|
150
171
|
},
|
|
151
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
172
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveAudioPage.json',
|
|
152
173
|
};
|
|
153
174
|
exports.LeaveError = {
|
|
154
175
|
eventType: 'Leave',
|
|
155
176
|
object: {
|
|
156
177
|
objectType: 'Error',
|
|
157
178
|
},
|
|
158
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
179
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveError.json',
|
|
159
180
|
};
|
|
160
181
|
exports.LeaveFrontpage = {
|
|
161
182
|
eventType: 'Leave',
|
|
162
183
|
object: {
|
|
163
184
|
objectType: 'Frontpage',
|
|
164
185
|
},
|
|
165
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
186
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveFrontpage.json',
|
|
166
187
|
};
|
|
167
188
|
exports.LeaveLandingpage = {
|
|
168
189
|
eventType: 'Leave',
|
|
169
190
|
object: {
|
|
170
191
|
objectType: 'Landingpage',
|
|
171
192
|
},
|
|
172
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
193
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveLandingpage.json',
|
|
173
194
|
};
|
|
174
195
|
exports.LeaveListing = {
|
|
175
196
|
eventType: 'Leave',
|
|
176
197
|
object: {
|
|
177
198
|
objectType: 'Listing',
|
|
178
199
|
},
|
|
179
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
200
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveListing.json',
|
|
180
201
|
};
|
|
181
202
|
exports.LeaveLockedArticle = {
|
|
182
203
|
eventType: 'Leave',
|
|
183
204
|
object: {
|
|
184
205
|
objectType: 'LockedArticle',
|
|
185
206
|
},
|
|
186
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
207
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveLockedArticle.json',
|
|
187
208
|
};
|
|
188
209
|
exports.LeaveLockedAudioPage = {
|
|
189
210
|
eventType: 'Leave',
|
|
190
211
|
object: {
|
|
191
212
|
objectType: 'LockedAudioPage',
|
|
192
213
|
},
|
|
193
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
214
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveLockedAudioPage.json',
|
|
194
215
|
};
|
|
195
216
|
exports.LeaveLockedVideoPage = {
|
|
196
217
|
eventType: 'Leave',
|
|
197
218
|
object: {
|
|
198
219
|
objectType: 'LockedVideoPage',
|
|
199
220
|
},
|
|
200
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
221
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveLockedVideoPage.json',
|
|
201
222
|
};
|
|
202
223
|
exports.LeavePage = {
|
|
203
224
|
eventType: 'Leave',
|
|
204
225
|
object: {
|
|
205
226
|
objectType: 'Page',
|
|
206
227
|
},
|
|
207
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
228
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeavePage.json',
|
|
208
229
|
};
|
|
209
230
|
exports.LeaveSportsPage = {
|
|
210
231
|
eventType: 'Leave',
|
|
211
232
|
object: {
|
|
212
233
|
objectType: 'SportsPage',
|
|
213
234
|
},
|
|
214
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
235
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveSportsPage.json',
|
|
215
236
|
};
|
|
216
237
|
exports.LeaveVideoPage = {
|
|
217
238
|
eventType: 'Leave',
|
|
218
239
|
object: {
|
|
219
240
|
objectType: 'VideoPage',
|
|
220
241
|
},
|
|
221
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
242
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveVideoPage.json',
|
|
222
243
|
};
|
|
223
244
|
exports.LeaveWeather = {
|
|
224
245
|
eventType: 'Leave',
|
|
225
246
|
object: {
|
|
226
247
|
objectType: 'Weather',
|
|
227
248
|
},
|
|
228
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
249
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/LeaveWeather.json',
|
|
229
250
|
};
|
|
230
251
|
exports.ViewArticle = {
|
|
231
252
|
eventType: 'View',
|
|
232
253
|
object: {
|
|
233
254
|
objectType: 'Article',
|
|
234
255
|
},
|
|
235
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
256
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewArticle.json',
|
|
236
257
|
};
|
|
237
258
|
exports.ViewAudioPage = {
|
|
238
259
|
eventType: 'View',
|
|
239
260
|
object: {
|
|
240
261
|
objectType: 'AudioPage',
|
|
241
262
|
},
|
|
242
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
263
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewAudioPage.json',
|
|
243
264
|
};
|
|
244
265
|
exports.ViewError = {
|
|
245
266
|
eventType: 'View',
|
|
246
267
|
object: {
|
|
247
268
|
objectType: 'Error',
|
|
248
269
|
},
|
|
249
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
270
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewError.json',
|
|
250
271
|
};
|
|
251
272
|
exports.ViewFrontpage = {
|
|
252
273
|
eventType: 'View',
|
|
253
274
|
object: {
|
|
254
275
|
objectType: 'Frontpage',
|
|
255
276
|
},
|
|
256
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
277
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewFrontpage.json',
|
|
257
278
|
};
|
|
258
279
|
exports.ViewHealthPage = {
|
|
259
280
|
eventType: 'View',
|
|
260
281
|
object: {
|
|
261
282
|
objectType: 'HealthPage',
|
|
262
283
|
},
|
|
263
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
284
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewHealthPage.json',
|
|
264
285
|
};
|
|
265
286
|
exports.ViewLandingpage = {
|
|
266
287
|
eventType: 'View',
|
|
267
288
|
object: {
|
|
268
289
|
objectType: 'Landingpage',
|
|
269
290
|
},
|
|
270
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
291
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewLandingpage.json',
|
|
271
292
|
};
|
|
272
293
|
exports.ViewListing = {
|
|
273
294
|
eventType: 'View',
|
|
274
295
|
object: {
|
|
275
296
|
objectType: 'Listing',
|
|
276
297
|
},
|
|
277
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
298
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewListing.json',
|
|
278
299
|
};
|
|
279
300
|
exports.ViewLockedArticle = {
|
|
280
301
|
eventType: 'View',
|
|
281
302
|
object: {
|
|
282
303
|
objectType: 'LockedArticle',
|
|
283
304
|
},
|
|
284
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
305
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewLockedArticle.json',
|
|
285
306
|
};
|
|
286
307
|
exports.ViewLockedAudioPage = {
|
|
287
308
|
eventType: 'View',
|
|
288
309
|
object: {
|
|
289
310
|
objectType: 'LockedAudioPage',
|
|
290
311
|
},
|
|
291
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
312
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewLockedAudioPage.json',
|
|
292
313
|
};
|
|
293
314
|
exports.ViewLockedVideoPage = {
|
|
294
315
|
eventType: 'View',
|
|
295
316
|
object: {
|
|
296
317
|
objectType: 'LockedVideoPage',
|
|
297
318
|
},
|
|
298
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
319
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewLockedVideoPage.json',
|
|
299
320
|
};
|
|
300
321
|
exports.ViewPage = {
|
|
301
322
|
eventType: 'View',
|
|
302
323
|
object: {
|
|
303
324
|
objectType: 'Page',
|
|
304
325
|
},
|
|
305
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
326
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewPage.json',
|
|
306
327
|
};
|
|
307
328
|
exports.ViewSportsPage = {
|
|
308
329
|
eventType: 'View',
|
|
309
330
|
object: {
|
|
310
331
|
objectType: 'SportsPage',
|
|
311
332
|
},
|
|
312
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
333
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewSportsPage.json',
|
|
313
334
|
};
|
|
314
335
|
exports.ViewTitle = {
|
|
315
336
|
eventType: 'View',
|
|
316
337
|
object: {
|
|
317
338
|
objectType: 'Title',
|
|
318
339
|
},
|
|
319
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
340
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewTitle.json',
|
|
320
341
|
};
|
|
321
342
|
exports.ViewVideoPage = {
|
|
322
343
|
eventType: 'View',
|
|
323
344
|
object: {
|
|
324
345
|
objectType: 'VideoPage',
|
|
325
346
|
},
|
|
326
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
347
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewVideoPage.json',
|
|
327
348
|
};
|
|
328
349
|
exports.ViewWeather = {
|
|
329
350
|
eventType: 'View',
|
|
330
351
|
object: {
|
|
331
352
|
objectType: 'Weather',
|
|
332
353
|
},
|
|
333
|
-
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.
|
|
354
|
+
schema: 'https://tpaas-schemas.schibsted.media/catalogs/versions/2.11.0/schemas/ViewWeather.json',
|
|
334
355
|
};
|
|
335
356
|
exports.ADVERTISING_VALUES = ['Accepted', 'Rejected', 'Unknown'];
|
|
336
357
|
exports.ANALYTICS_VALUES = ['Accepted', 'Rejected', 'Unknown'];
|
|
@@ -387,11 +408,13 @@ exports.PAGE_TYPE_VALUES = [
|
|
|
387
408
|
'Title',
|
|
388
409
|
'VideoPage',
|
|
389
410
|
'Weather',
|
|
411
|
+
'AppWidget',
|
|
412
|
+
'Notification',
|
|
390
413
|
];
|
|
391
414
|
exports.COLUMN_NAME_VALUES = ['main', 'aside'];
|
|
392
415
|
exports.FOLD_POSITION_VALUES = ['Above', 'Below', 'Unknown'];
|
|
393
416
|
exports.PRIMARY_AXIS_VALUES = ['Horizontal', 'Vertical'];
|
|
394
|
-
exports.STAGE_VALUES = ['Dev', '
|
|
417
|
+
exports.STAGE_VALUES = ['Dev', 'Pre', 'Pro'];
|
|
395
418
|
exports.SPORT_EVENT_COVERAGE_VALUES = ['Manual', 'SemiAutomatic', 'Automatic'];
|
|
396
419
|
exports.SPORT_EVENT_STATUS_VALUES = [
|
|
397
420
|
'NotStarted',
|
|
@@ -441,6 +464,7 @@ exports.SPORT_VIEW_VALUES = [
|
|
|
441
464
|
'Studio',
|
|
442
465
|
];
|
|
443
466
|
exports.USER_THEME_VALUES = ['Light', 'Dark', 'System', 'Other'];
|
|
467
|
+
exports.ROUTING_STAGE_VALUES = ['Dev', 'Pre', 'Pro'];
|
|
444
468
|
exports.TRACKER_TYPE_VALUES = ['JS', 'IOS', 'Android', 'Backend'];
|
|
445
469
|
exports.REGION_VALUES = ['Norway', 'Sweden', 'Finland'];
|
|
446
470
|
exports.UTM_MEDIUM_VALUES = [
|
|
@@ -454,4 +478,4 @@ exports.UTM_MEDIUM_VALUES = [
|
|
|
454
478
|
'Video',
|
|
455
479
|
'Internal',
|
|
456
480
|
];
|
|
457
|
-
exports.CATALOG_VERSION = '2.
|
|
481
|
+
exports.CATALOG_VERSION = '2.11.0';
|
|
@@ -12,17 +12,20 @@ exports.MESSAGE_TYPE_RETURN_ERROR = `${exports.MESSAGE_PREFIX}:return-error`;
|
|
|
12
12
|
exports.ALLOWED_METHODS = ['track'];
|
|
13
13
|
exports.TPAAS_ALLOWED_METHODS = [
|
|
14
14
|
'trackAnonymousViewUIElement',
|
|
15
|
+
'trackEngagementAffiliate',
|
|
15
16
|
'trackEngagementAudio',
|
|
16
17
|
'trackEngagementForm',
|
|
17
18
|
'trackEngagementHealthUIElement',
|
|
18
19
|
'trackEngagementOffer',
|
|
19
20
|
'trackEngagementTeaser',
|
|
21
|
+
'trackEngagementTvModule',
|
|
20
22
|
'trackEngagementUIElement',
|
|
21
23
|
'trackEngagementVideo',
|
|
22
24
|
'trackEngagementVideoAd',
|
|
23
25
|
'trackEngagementWidget',
|
|
24
26
|
'trackCompletedHealthAction',
|
|
25
27
|
'trackImpressionAdSlot',
|
|
28
|
+
'trackImpressionAffiliate',
|
|
26
29
|
'trackImpressionForm',
|
|
27
30
|
'trackImpressionHealthUIElement',
|
|
28
31
|
'trackImpressionOffer',
|
package/dist/cjs/version.js
CHANGED
package/dist/ejs/Tracker.js
CHANGED
|
@@ -18,7 +18,7 @@ import { addPageLeaveTracking, leaveTrackingIsActive, removePageLeaveTracking, r
|
|
|
18
18
|
import { addTpaasLeaveTracking, getTpaasLeaveObject, leaveTpaasTrackingIsActive, resetTpaasViewedContent, shouldEnableLeaveTracking, trackTpaasActiveLeave, updateTpaasLeaveTracking, updateTpaasViewedContent, } from './leaveTrackingTpaas';
|
|
19
19
|
import send from './network';
|
|
20
20
|
import * as config from './remoteConfig';
|
|
21
|
-
import { buildAnonymousViewUIElementEvent, buildCompletedHealthActionEvent, buildEngagementAudioEvent, buildEngagementFormEvent, buildEngagementHealthUIElementEvent, buildEngagementOfferEvent, buildEngagementTeaserEvent, buildEngagementUIElementEvent, buildEngagementVideoAdEvent, buildEngagementVideoEvent, buildEngagementWidgetEvent, buildImpressionAdSlotEvent, buildImpressionFormEvent, buildImpressionHealthUIElementEvent, buildImpressionOfferEvent, buildImpressionPlayerEvent, buildImpressionTeaserEvent, buildImpressionUIElementEvent, buildImpressionWidgetEvent, buildLeaveArticleEvent, buildLeaveAudioPageEvent, buildLeaveErrorEvent, buildLeaveFrontpageEvent, buildLeaveLandingpageEvent, buildLeaveListingEvent, buildLeaveLockedArticleEvent, buildLeaveLockedAudioPageEvent, buildLeaveLockedVideoPageEvent, buildLeavePageEvent, buildLeaveSportsPageEvent, buildLeaveVideoPageEvent, buildLeaveWeatherEvent, buildViewArticleEvent, buildViewAudioPageEvent, buildViewErrorEvent, buildViewFrontpageEvent, buildViewHealthPageEvent, buildViewLandingpageEvent, buildViewListingEvent, buildViewLockedArticleEvent, buildViewLockedAudioPageEvent, buildViewLockedVideoPageEvent, buildViewPageEvent, buildViewSportsPageEvent, buildViewTitleEvent, buildViewVideoPageEvent, buildViewWeatherEvent, } from './tpaas-builders';
|
|
21
|
+
import { buildAnonymousViewUIElementEvent, buildCompletedHealthActionEvent, buildEngagementAffiliateEvent, buildEngagementAudioEvent, buildEngagementFormEvent, buildEngagementHealthUIElementEvent, buildEngagementOfferEvent, buildEngagementTeaserEvent, buildEngagementTvModuleEvent, buildEngagementUIElementEvent, buildEngagementVideoAdEvent, buildEngagementVideoEvent, buildEngagementWidgetEvent, buildImpressionAdSlotEvent, buildImpressionAffiliateEvent, buildImpressionFormEvent, buildImpressionHealthUIElementEvent, buildImpressionOfferEvent, buildImpressionPlayerEvent, buildImpressionTeaserEvent, buildImpressionUIElementEvent, buildImpressionWidgetEvent, buildLeaveArticleEvent, buildLeaveAudioPageEvent, buildLeaveErrorEvent, buildLeaveFrontpageEvent, buildLeaveLandingpageEvent, buildLeaveListingEvent, buildLeaveLockedArticleEvent, buildLeaveLockedAudioPageEvent, buildLeaveLockedVideoPageEvent, buildLeavePageEvent, buildLeaveSportsPageEvent, buildLeaveVideoPageEvent, buildLeaveWeatherEvent, buildViewArticleEvent, buildViewAudioPageEvent, buildViewErrorEvent, buildViewFrontpageEvent, buildViewHealthPageEvent, buildViewLandingpageEvent, buildViewListingEvent, buildViewLockedArticleEvent, buildViewLockedAudioPageEvent, buildViewLockedVideoPageEvent, buildViewPageEvent, buildViewSportsPageEvent, buildViewTitleEvent, buildViewVideoPageEvent, buildViewWeatherEvent, } from './tpaas-builders';
|
|
22
22
|
import { LeaveArticle, LeaveAudioPage, LeaveError, LeaveFrontpage, LeaveLandingpage, LeaveListing, LeaveLockedArticle, LeaveLockedAudioPage, LeaveLockedVideoPage, LeavePage, LeaveSportsPage, LeaveVideoPage, LeaveWeather, ViewArticle, ViewAudioPage, ViewError, ViewFrontpage, ViewHealthPage, ViewLandingpage, ViewListing, ViewLockedArticle, ViewLockedAudioPage, ViewLockedVideoPage, ViewPage, ViewSportsPage, ViewTitle, ViewVideoPage, ViewWeather, } from './tpaas-schemas';
|
|
23
23
|
import { startProxyProviderListener } from './tracker-proxy/proxy-provider';
|
|
24
24
|
import { evaluateAndFlatten, isBrowser, isFunction, isPromise, isString, pulseMerge, throttle } from './utils';
|
|
@@ -71,6 +71,17 @@ const anonymousEvents = {
|
|
|
71
71
|
function getAnonymousEventBuilder(name) {
|
|
72
72
|
return name in anonymousEvents ? anonymousEvents[name] : anonymousEvents.trackerEvent;
|
|
73
73
|
}
|
|
74
|
+
// This looks overkill, but a mapping feels safer than doing string operations (capitalize) with javascript
|
|
75
|
+
const mapDeployStageToTpaasStage = (deployStage) => {
|
|
76
|
+
switch (deployStage) {
|
|
77
|
+
case 'dev':
|
|
78
|
+
return 'Dev';
|
|
79
|
+
case 'pre':
|
|
80
|
+
return 'Pre';
|
|
81
|
+
case 'pro':
|
|
82
|
+
return 'Pro';
|
|
83
|
+
}
|
|
84
|
+
};
|
|
74
85
|
/**
|
|
75
86
|
* Determines if the SDK is running in a Hybrid (WebView) environment.
|
|
76
87
|
*
|
|
@@ -481,6 +492,7 @@ export default class Tracker {
|
|
|
481
492
|
providerGroup: this.state.provider?.group,
|
|
482
493
|
component: this.state.component,
|
|
483
494
|
componentVersion: this.state.componentVersion,
|
|
495
|
+
routingStage: mapDeployStageToTpaasStage(this.state.deployStageTpaas),
|
|
484
496
|
experiments,
|
|
485
497
|
currentPageReferrer,
|
|
486
498
|
};
|
|
@@ -565,6 +577,7 @@ export default class Tracker {
|
|
|
565
577
|
component: this.state.component,
|
|
566
578
|
componentVersion: this.state.componentVersion,
|
|
567
579
|
pageviewId: this.state.pageViewId,
|
|
580
|
+
routingStage: mapDeployStageToTpaasStage(this.state.deployStageTpaas),
|
|
568
581
|
currentPage,
|
|
569
582
|
currentPageReferrer,
|
|
570
583
|
experiments,
|
|
@@ -1065,6 +1078,15 @@ export default class Tracker {
|
|
|
1065
1078
|
const event = buildImpressionAdSlotEvent(input, dependencies);
|
|
1066
1079
|
return this.sendTpaasEvent(event);
|
|
1067
1080
|
}
|
|
1081
|
+
/**
|
|
1082
|
+
* @param input
|
|
1083
|
+
* @category TPaaS Tracking
|
|
1084
|
+
*/
|
|
1085
|
+
async trackImpressionAffiliate(input) {
|
|
1086
|
+
const dependencies = await this.prepareTpaasEvent();
|
|
1087
|
+
const event = buildImpressionAffiliateEvent(input, dependencies);
|
|
1088
|
+
return this.sendTpaasEvent(event);
|
|
1089
|
+
}
|
|
1068
1090
|
/**
|
|
1069
1091
|
* @param input
|
|
1070
1092
|
* @category TPaaS Tracking
|
|
@@ -1479,6 +1501,15 @@ export default class Tracker {
|
|
|
1479
1501
|
const event = buildLeaveWeatherEvent(input, dependencies);
|
|
1480
1502
|
return this.sendTpaasEvent(event);
|
|
1481
1503
|
}
|
|
1504
|
+
/**
|
|
1505
|
+
* @param input
|
|
1506
|
+
* @category TPaaS Tracking
|
|
1507
|
+
*/
|
|
1508
|
+
async trackEngagementAffiliate(input) {
|
|
1509
|
+
const dependencies = await this.prepareTpaasEvent();
|
|
1510
|
+
const event = buildEngagementAffiliateEvent(input, dependencies);
|
|
1511
|
+
return this.sendTpaasEvent(event);
|
|
1512
|
+
}
|
|
1482
1513
|
/**
|
|
1483
1514
|
* @param input
|
|
1484
1515
|
* @category TPaaS Tracking
|
|
@@ -1515,6 +1546,15 @@ export default class Tracker {
|
|
|
1515
1546
|
const event = buildEngagementTeaserEvent(input, dependencies);
|
|
1516
1547
|
return this.sendTpaasEvent(event);
|
|
1517
1548
|
}
|
|
1549
|
+
/**
|
|
1550
|
+
* @param input
|
|
1551
|
+
* @category TPaaS Tracking
|
|
1552
|
+
*/
|
|
1553
|
+
async trackEngagementTvModule(input) {
|
|
1554
|
+
const dependencies = await this.prepareTpaasEvent();
|
|
1555
|
+
const event = buildEngagementTvModuleEvent(input, dependencies);
|
|
1556
|
+
return this.sendTpaasEvent(event);
|
|
1557
|
+
}
|
|
1518
1558
|
/**
|
|
1519
1559
|
* @param input
|
|
1520
1560
|
* @category TPaaS Tracking
|
|
@@ -10,7 +10,8 @@ let activityListeners = [];
|
|
|
10
10
|
let resizeObserver = null;
|
|
11
11
|
let throttledUpdateFn = throttle(() => undefined, 0);
|
|
12
12
|
let durationStartTime = 0;
|
|
13
|
-
let
|
|
13
|
+
let previousActivityTime = 0;
|
|
14
|
+
let activityDurationMs = 0;
|
|
14
15
|
let currentLeaveEvent = DEFAULT_PAGE_LEAVE_EVENT();
|
|
15
16
|
let additionalHeightBuilder;
|
|
16
17
|
/**
|
|
@@ -43,8 +44,9 @@ export function addTpaasLeaveTracking({ objectElement, pageElement, schema, obje
|
|
|
43
44
|
additionalHeightBuilder = heightBuilder;
|
|
44
45
|
addTpaasLeaveListeners();
|
|
45
46
|
addUpdateEventListeners(objectDomElement, pageDomElement, objectResizable);
|
|
46
|
-
|
|
47
|
+
previousActivityTime = resetTime();
|
|
47
48
|
durationStartTime = resetTime();
|
|
49
|
+
activityDurationMs = 0;
|
|
48
50
|
currentLeaveSchema = schema;
|
|
49
51
|
currentTrackMethod = trackMethod;
|
|
50
52
|
logger.debug('addLeaveTracking:after:state', currentLeaveEvent);
|
|
@@ -137,7 +139,8 @@ function removeUpdateEventListeners() {
|
|
|
137
139
|
const resetEventDefaults = () => {
|
|
138
140
|
currentLeaveEvent = DEFAULT_PAGE_LEAVE_EVENT();
|
|
139
141
|
durationStartTime = resetTime();
|
|
140
|
-
|
|
142
|
+
previousActivityTime = resetTime();
|
|
143
|
+
activityDurationMs = 0;
|
|
141
144
|
};
|
|
142
145
|
export const resetTpaasViewedContent = () => {
|
|
143
146
|
currentLeaveEvent = DEFAULT_PAGE_LEAVE_EVENT();
|
|
@@ -175,11 +178,13 @@ export function getTpaasLeaveObject() {
|
|
|
175
178
|
const endTime = Date.now();
|
|
176
179
|
// TPaaS leave event requires duration/activity to be at least 1ms, otherwise the event is rejected
|
|
177
180
|
// also, in practice, it's almost impossible to have an activity or duration of 0ms
|
|
181
|
+
// We don't call increaseActivityDuration here because it's possible to call getTpaasLeaveObject multiple times
|
|
182
|
+
// without any activity events in between, which would incorrectly increase the activity duration.
|
|
178
183
|
const durationMs = Math.max(endTime - durationStartTime, 1);
|
|
179
|
-
const
|
|
184
|
+
const lastActivityDuration = calculateActivityGap(endTime);
|
|
180
185
|
const leave = {
|
|
181
186
|
durationMs,
|
|
182
|
-
activityDurationMs,
|
|
187
|
+
activityDurationMs: Math.max(activityDurationMs + lastActivityDuration, 1),
|
|
183
188
|
...currentLeaveEvent,
|
|
184
189
|
};
|
|
185
190
|
logger.debug('trackTpaasLeave: event', leave);
|
|
@@ -264,9 +269,16 @@ function addUpdateActivityDurationListeners() {
|
|
|
264
269
|
BrowserEvents.TOUCHSTART,
|
|
265
270
|
];
|
|
266
271
|
activityListeners = addEventListeners(activityEvents, () => {
|
|
267
|
-
|
|
272
|
+
increaseActivityDuration(Date.now());
|
|
268
273
|
}, { passive: true });
|
|
269
274
|
}
|
|
275
|
+
function calculateActivityGap(activityEndTime) {
|
|
276
|
+
return Math.min(activityEndTime - previousActivityTime, ACTIVITY_DURATION_LIMIT_MS);
|
|
277
|
+
}
|
|
278
|
+
function increaseActivityDuration(activityEndTime) {
|
|
279
|
+
activityDurationMs += calculateActivityGap(activityEndTime);
|
|
280
|
+
previousActivityTime = resetTime();
|
|
281
|
+
}
|
|
270
282
|
/*
|
|
271
283
|
Add listeners to a set of browser events.
|
|
272
284
|
*/
|
|
@@ -102,7 +102,7 @@ function getOperatingSystem(uaParser) {
|
|
|
102
102
|
if (osName.includes('windows')) {
|
|
103
103
|
return 'Windows';
|
|
104
104
|
}
|
|
105
|
-
if (osName.includes('macos')) {
|
|
105
|
+
if (osName.includes('macos') || osName.includes('mac os')) {
|
|
106
106
|
return 'Mac';
|
|
107
107
|
}
|
|
108
108
|
if (osName.includes('android')) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export const builder = (autoTrackerVersion, isHybrid, version) => {
|
|
1
|
+
export const builder = ({ autoTrackerVersion, isHybrid, routingStage, version, }) => {
|
|
2
2
|
return {
|
|
3
3
|
tracker: {
|
|
4
4
|
autoTrackerVersion,
|
|
5
5
|
isAutoTracker: !!autoTrackerVersion,
|
|
6
6
|
isHybrid,
|
|
7
|
+
routingStage,
|
|
7
8
|
trackerType: 'JS',
|
|
8
9
|
version,
|
|
9
10
|
},
|