@streamscloud/streams-analytics-collector 2.0.9 → 2.0.10
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.
|
@@ -129,6 +129,18 @@ export declare class AppEventsTracker {
|
|
|
129
129
|
* @param streamId - The ID of the stream
|
|
130
130
|
*/
|
|
131
131
|
static trackStreamProductImpressionWithVisibility(el: HTMLElement, productId: string, streamId: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* Track when a product in a stream is added to cart
|
|
134
|
+
* @param productId - The ID of the product
|
|
135
|
+
* @param streamId - The ID of the stream
|
|
136
|
+
*/
|
|
137
|
+
static trackStreamProductAddToCart(productId: string, streamId: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* Track when a product in a stream is checked out
|
|
140
|
+
* @param productId - The ID of the product
|
|
141
|
+
* @param streamId - The ID of the stream
|
|
142
|
+
*/
|
|
143
|
+
static trackStreamProductCheckout(productId: string, streamId: string): void;
|
|
132
144
|
/**
|
|
133
145
|
* Track when a post is closed
|
|
134
146
|
* @param postId - The ID of the post
|
|
@@ -197,6 +209,18 @@ export declare class AppEventsTracker {
|
|
|
197
209
|
* @param videoId - The ID of the short video containing the product
|
|
198
210
|
*/
|
|
199
211
|
static trackShortVideoProductImpressionWithVisibility(el: HTMLElement, productId: string, videoId: string): void;
|
|
212
|
+
/**
|
|
213
|
+
* Track when a product in a short video is added to cart
|
|
214
|
+
* @param productId - The ID of the product
|
|
215
|
+
* @param videoId - The ID of the short video containing the product
|
|
216
|
+
*/
|
|
217
|
+
static trackShortVideoProductAddToCart(productId: string, videoId: string): void;
|
|
218
|
+
/**
|
|
219
|
+
* Track when a product in a short video is checked out
|
|
220
|
+
* @param productId - The ID of the product
|
|
221
|
+
* @param videoId - The ID of the short video containing the product
|
|
222
|
+
*/
|
|
223
|
+
static trackShortVideoProductCheckout(productId: string, videoId: string): void;
|
|
200
224
|
/**
|
|
201
225
|
* Report an app event to the API
|
|
202
226
|
* @private
|
|
@@ -209,6 +209,22 @@ class AppEventsTracker {
|
|
|
209
209
|
});
|
|
210
210
|
// The ViewportVisibilityTracker will call the callback when visible
|
|
211
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Track when a product in a stream is added to cart
|
|
214
|
+
* @param productId - The ID of the product
|
|
215
|
+
* @param streamId - The ID of the stream
|
|
216
|
+
*/
|
|
217
|
+
static trackStreamProductAddToCart(productId, streamId) {
|
|
218
|
+
this.reportAppEvent(productId, AppEventType.StreamProductAddToCart, streamId);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Track when a product in a stream is checked out
|
|
222
|
+
* @param productId - The ID of the product
|
|
223
|
+
* @param streamId - The ID of the stream
|
|
224
|
+
*/
|
|
225
|
+
static trackStreamProductCheckout(productId, streamId) {
|
|
226
|
+
this.reportAppEvent(productId, AppEventType.StreamProductCheckout, streamId);
|
|
227
|
+
}
|
|
212
228
|
/**
|
|
213
229
|
* Track when a post is closed
|
|
214
230
|
* @param postId - The ID of the post
|
|
@@ -323,6 +339,22 @@ class AppEventsTracker {
|
|
|
323
339
|
});
|
|
324
340
|
// The ViewportVisibilityTracker will call the callback when visible
|
|
325
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Track when a product in a short video is added to cart
|
|
344
|
+
* @param productId - The ID of the product
|
|
345
|
+
* @param videoId - The ID of the short video containing the product
|
|
346
|
+
*/
|
|
347
|
+
static trackShortVideoProductAddToCart(productId, videoId) {
|
|
348
|
+
this.reportAppEvent(productId, AppEventType.ShortVideoProductAddToCart, videoId);
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Track when a product in a short video is checked out
|
|
352
|
+
* @param productId - The ID of the product
|
|
353
|
+
* @param videoId - The ID of the short video containing the product
|
|
354
|
+
*/
|
|
355
|
+
static trackShortVideoProductCheckout(productId, videoId) {
|
|
356
|
+
this.reportAppEvent(productId, AppEventType.ShortVideoProductCheckout, videoId);
|
|
357
|
+
}
|
|
326
358
|
/**
|
|
327
359
|
* Report an app event to the API
|
|
328
360
|
* @private
|
|
@@ -5,11 +5,15 @@ export declare enum AppEventType {
|
|
|
5
5
|
ContributionCreated = "CONTRIBUTION_CREATED",
|
|
6
6
|
PostView = "POST_VIEW",
|
|
7
7
|
ShortVideoImpression = "SHORT_VIDEO_IMPRESSION",
|
|
8
|
+
ShortVideoProductAddToCart = "SHORT_VIDEO_PRODUCT_ADD_TO_CART",
|
|
9
|
+
ShortVideoProductCheckout = "SHORT_VIDEO_PRODUCT_CHECKOUT",
|
|
8
10
|
ShortVideoProductClick = "SHORT_VIDEO_PRODUCT_CLICK",
|
|
9
11
|
ShortVideoProductImpression = "SHORT_VIDEO_PRODUCT_IMPRESSION",
|
|
10
12
|
ShortVideoView = "SHORT_VIDEO_VIEW",
|
|
11
13
|
StreamEngagementTime = "STREAM_ENGAGEMENT_TIME",
|
|
12
14
|
StreamPageView = "STREAM_PAGE_VIEW",
|
|
15
|
+
StreamProductAddToCart = "STREAM_PRODUCT_ADD_TO_CART",
|
|
16
|
+
StreamProductCheckout = "STREAM_PRODUCT_CHECKOUT",
|
|
13
17
|
StreamProductClick = "STREAM_PRODUCT_CLICK",
|
|
14
18
|
StreamProductImpression = "STREAM_PRODUCT_IMPRESSION",
|
|
15
19
|
StreamScrollDepth = "STREAM_SCROLL_DEPTH",
|
package/dist/analytics/types.js
CHANGED
|
@@ -6,11 +6,15 @@ var AppEventType;
|
|
|
6
6
|
AppEventType["ContributionCreated"] = "CONTRIBUTION_CREATED";
|
|
7
7
|
AppEventType["PostView"] = "POST_VIEW";
|
|
8
8
|
AppEventType["ShortVideoImpression"] = "SHORT_VIDEO_IMPRESSION";
|
|
9
|
+
AppEventType["ShortVideoProductAddToCart"] = "SHORT_VIDEO_PRODUCT_ADD_TO_CART";
|
|
10
|
+
AppEventType["ShortVideoProductCheckout"] = "SHORT_VIDEO_PRODUCT_CHECKOUT";
|
|
9
11
|
AppEventType["ShortVideoProductClick"] = "SHORT_VIDEO_PRODUCT_CLICK";
|
|
10
12
|
AppEventType["ShortVideoProductImpression"] = "SHORT_VIDEO_PRODUCT_IMPRESSION";
|
|
11
13
|
AppEventType["ShortVideoView"] = "SHORT_VIDEO_VIEW";
|
|
12
14
|
AppEventType["StreamEngagementTime"] = "STREAM_ENGAGEMENT_TIME";
|
|
13
15
|
AppEventType["StreamPageView"] = "STREAM_PAGE_VIEW";
|
|
16
|
+
AppEventType["StreamProductAddToCart"] = "STREAM_PRODUCT_ADD_TO_CART";
|
|
17
|
+
AppEventType["StreamProductCheckout"] = "STREAM_PRODUCT_CHECKOUT";
|
|
14
18
|
AppEventType["StreamProductClick"] = "STREAM_PRODUCT_CLICK";
|
|
15
19
|
AppEventType["StreamProductImpression"] = "STREAM_PRODUCT_IMPRESSION";
|
|
16
20
|
AppEventType["StreamScrollDepth"] = "STREAM_SCROLL_DEPTH";
|