@streamscloud/streams-analytics-collector 2.0.6 → 2.0.8
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.
|
@@ -162,13 +162,15 @@ export declare class AppEventsTracker {
|
|
|
162
162
|
/**
|
|
163
163
|
* Track when a product in a short video is clicked
|
|
164
164
|
* @param productId - The ID of the product
|
|
165
|
+
* @param videoId - The ID of the short video containing the product
|
|
165
166
|
*/
|
|
166
|
-
static trackShortVideoProductClick(productId: string): void;
|
|
167
|
+
static trackShortVideoProductClick(productId: string, videoId: string): void;
|
|
167
168
|
/**
|
|
168
169
|
* Track when a product in a short video is shown to the user (basic, immediate call)
|
|
169
170
|
* @param productId - The ID of the product
|
|
171
|
+
* @param videoId - The ID of the short video containing the product
|
|
170
172
|
*/
|
|
171
|
-
static trackShortVideoProductImpression(productId: string): void;
|
|
173
|
+
static trackShortVideoProductImpression(productId: string, videoId: string): void;
|
|
172
174
|
/**
|
|
173
175
|
* Track when a product in a short video is shown to the user, using viewport visibility tracking.
|
|
174
176
|
* The impression event will only be fired if the element becomes visible (at least 50% in viewport).
|
|
@@ -176,8 +178,9 @@ export declare class AppEventsTracker {
|
|
|
176
178
|
*
|
|
177
179
|
* @param el - The DOM element to observe (e.g., the product element)
|
|
178
180
|
* @param productId - The unique product ID for this element
|
|
181
|
+
* @param videoId - The ID of the short video containing the product
|
|
179
182
|
*/
|
|
180
|
-
static trackShortVideoProductImpressionWithVisibility(el: HTMLElement, productId: string): void;
|
|
183
|
+
static trackShortVideoProductImpressionWithVisibility(el: HTMLElement, productId: string, videoId: string): void;
|
|
181
184
|
/**
|
|
182
185
|
* Report an app event to the API
|
|
183
186
|
* @private
|
|
@@ -268,16 +268,18 @@ class AppEventsTracker {
|
|
|
268
268
|
/**
|
|
269
269
|
* Track when a product in a short video is clicked
|
|
270
270
|
* @param productId - The ID of the product
|
|
271
|
+
* @param videoId - The ID of the short video containing the product
|
|
271
272
|
*/
|
|
272
|
-
static trackShortVideoProductClick(productId) {
|
|
273
|
-
this.reportAppEvent(productId, AppEventType.ShortVideoProductClick);
|
|
273
|
+
static trackShortVideoProductClick(productId, videoId) {
|
|
274
|
+
this.reportAppEvent(productId, AppEventType.ShortVideoProductClick, videoId);
|
|
274
275
|
}
|
|
275
276
|
/**
|
|
276
277
|
* Track when a product in a short video is shown to the user (basic, immediate call)
|
|
277
278
|
* @param productId - The ID of the product
|
|
279
|
+
* @param videoId - The ID of the short video containing the product
|
|
278
280
|
*/
|
|
279
|
-
static trackShortVideoProductImpression(productId) {
|
|
280
|
-
this.reportAppEvent(productId, AppEventType.ShortVideoProductImpression);
|
|
281
|
+
static trackShortVideoProductImpression(productId, videoId) {
|
|
282
|
+
this.reportAppEvent(productId, AppEventType.ShortVideoProductImpression, videoId);
|
|
281
283
|
}
|
|
282
284
|
/**
|
|
283
285
|
* Track when a product in a short video is shown to the user, using viewport visibility tracking.
|
|
@@ -286,12 +288,13 @@ class AppEventsTracker {
|
|
|
286
288
|
*
|
|
287
289
|
* @param el - The DOM element to observe (e.g., the product element)
|
|
288
290
|
* @param productId - The unique product ID for this element
|
|
291
|
+
* @param videoId - The ID of the short video containing the product
|
|
289
292
|
*/
|
|
290
|
-
static trackShortVideoProductImpressionWithVisibility(el, productId) {
|
|
291
|
-
if (!el || !productId)
|
|
293
|
+
static trackShortVideoProductImpressionWithVisibility(el, productId, videoId) {
|
|
294
|
+
if (!el || !productId || !videoId)
|
|
292
295
|
return;
|
|
293
296
|
ViewportVisibilityTracker.registerTile(el, productId, (pid) => {
|
|
294
|
-
this.reportAppEvent(pid, AppEventType.ShortVideoProductImpression);
|
|
297
|
+
this.reportAppEvent(pid, AppEventType.ShortVideoProductImpression, videoId);
|
|
295
298
|
});
|
|
296
299
|
// The ViewportVisibilityTracker will call the callback when visible
|
|
297
300
|
}
|