@artisan-commerce/analytics-rn 0.3.0-canary.149 → 0.3.0-canary.151

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.
Files changed (3) hide show
  1. package/dist/bundle.d.ts +276 -16
  2. package/dist/bundle.mjs +2047 -1306
  3. package/package.json +6 -6
package/dist/bundle.d.ts CHANGED
@@ -155,7 +155,13 @@ interface GoogleAnalyticsProviderConfig {
155
155
  * @since 0.1.0
156
156
  * @extends EventCommonParams
157
157
  */
158
- interface GoogleAnalyticsCommonEventParams extends EventCommonParams {
158
+ interface GoogleAnalyticsCommonEventParams extends EventCommonParams, EcommerceCommonParams {
159
+ callback?: () => void;
160
+ store_id?: string;
161
+ store_name?: string;
162
+ vendor_id?: string;
163
+ ocassion?: "delivery" | "pickup" | "coupon";
164
+ items?: Gtag.Item[];
159
165
  }
160
166
  /**
161
167
  * Google Analytics custom event shared parameters.
@@ -168,10 +174,11 @@ interface GoogleAnalyticsCustomEventParams {
168
174
  }
169
175
  declare namespace Gtag {
170
176
  interface Item {
171
- item_id: string;
172
- item_name: string;
177
+ item_id?: string;
178
+ item_name?: string;
173
179
  affiliation?: string;
174
180
  coupon?: string;
181
+ currency?: CurrencyCodes;
175
182
  creative_name?: string;
176
183
  creative_slot?: string;
177
184
  discount?: number;
@@ -186,10 +193,14 @@ declare namespace Gtag {
186
193
  item_list_name?: string;
187
194
  item_variant?: string;
188
195
  location_id?: string;
196
+ price_in_usd?: number;
189
197
  price?: number;
190
198
  promotion_id?: string;
191
199
  promotion_name?: string;
192
200
  quantity?: number;
201
+ original_item?: string;
202
+ item_revenue_in_usd?: number;
203
+ item_revenue?: number;
193
204
  }
194
205
  }
195
206
 
@@ -256,6 +267,29 @@ interface EventCommonParams {
256
267
  isAnonymous?: boolean;
257
268
  currency?: CurrencyCodes;
258
269
  }
270
+ interface EcommerceCommonParams {
271
+ total_item_quantity?: number;
272
+ purchase_revenue_in_usd?: number;
273
+ purchase_revenue?: number;
274
+ refund_value_in_usd?: number;
275
+ refund_value?: number;
276
+ shipping_value_in_usd?: number;
277
+ shipping_value?: number;
278
+ tax_value_in_usd?: number;
279
+ tax_value?: number;
280
+ unique_items?: string;
281
+ transaction_id?: string;
282
+ payment_type?: string;
283
+ coupon?: boolean;
284
+ currency?: CurrencyCodes;
285
+ }
286
+ interface UserProperties {
287
+ first_open_time?: boolean;
288
+ user_type?: "registered" | "anonymous";
289
+ user_status?: "new" | "returning";
290
+ ga_session_id?: string;
291
+ ga_session_number?: string;
292
+ }
259
293
 
260
294
  /**
261
295
  * Facebook Pixel Provider constructor configuration.
@@ -1276,7 +1310,7 @@ type RemoveProductFromWishlistParams = RemoveProductFromWishlistParams$3 & Remov
1276
1310
  * @extends GoogleAnalyticsCustomEventParams
1277
1311
  * @extends RemoveProductFromCartCommonParams
1278
1312
  */
1279
- interface RemoveProductFromCartParams$3 extends GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams, RemoveProductFromCartCommonParams {
1313
+ interface RemoveProductFromCartParams$3 extends Omit<GoogleAnalyticsCommonEventParams, "storeId" | "storeName">, GoogleAnalyticsCustomEventParams, RemoveProductFromCartCommonParams {
1280
1314
  }
1281
1315
 
1282
1316
  /**
@@ -1320,7 +1354,8 @@ interface RemoveProductFromCartCommonParams {
1320
1354
  product: CartProduct;
1321
1355
  cartId: ShoppingCart["id"];
1322
1356
  cartName?: ShoppingCart["name"];
1323
- store: Store;
1357
+ storeId: Store["storeId"];
1358
+ storeName: Store["storeName"];
1324
1359
  priceCategory?: PriceCategoryType;
1325
1360
  }
1326
1361
  /**
@@ -1492,18 +1527,22 @@ interface AddProductToCartParams$1 extends SegmentCommonEventParams, SegmentCust
1492
1527
  *
1493
1528
  * @interface AddProductToCartCommonParams
1494
1529
  * @since 0.1.0
1495
- * @property {CartProduct} product The product that was added to the cart
1496
- * @property {string} cartId Shopping cart identifier
1497
- * @property {string} cartName Shopping cart name
1498
- * @property {Store} store Store where the user is buying the product
1499
- * @property {PriceCategoryType} priceCategory The product price category identifier
1500
1530
  */
1501
1531
  interface AddProductToCartCommonParams {
1532
+ /** The product that was added to the cart */
1502
1533
  product: CartProduct;
1534
+ /** Shopping cart identifier */
1503
1535
  cartId: ShoppingCart["id"];
1536
+ /** Shopping cart name */
1504
1537
  cartName?: ShoppingCart["name"];
1505
- store: Store;
1538
+ /** The store ID where the user is buying the product */
1539
+ storeId: Store["storeId"];
1540
+ /** The store name where the user is buying the product */
1541
+ storeName: Store["storeName"];
1542
+ /** The product price category identifier */
1506
1543
  priceCategory?: PriceCategoryType;
1544
+ /** Param used to add `item_list_name` inside the items array */
1545
+ list?: string;
1507
1546
  }
1508
1547
  /**
1509
1548
  * addProductToCart event params.
@@ -1998,12 +2037,12 @@ interface ViewProductDetailsParams$1 extends SegmentCommonEventParams, SegmentCu
1998
2037
  *
1999
2038
  * @interface ViewProductDetailsCommonParams
2000
2039
  * @since 0.1.0
2001
- * @property {Product} product the product that the details are being viewed
2002
- * @property {string} categoryId if the user came from a category list, the category id
2003
2040
  */
2004
2041
  interface ViewProductDetailsCommonParams {
2042
+ /** The details of the product that the user is viewing */
2005
2043
  product: Product;
2006
- categorId?: string;
2044
+ /** The list that the product belongs to, this is used to add `item_list_name` to the items array */
2045
+ list?: string;
2007
2046
  }
2008
2047
  /**
2009
2048
  * viewProductDetails event params.
@@ -3337,6 +3376,219 @@ interface RequestAssistanceCommonParams {
3337
3376
  */
3338
3377
  type RequestAssistanceParams = RequestAssistanceParams$3 & RequestAssistanceParams$2 & RequestAssistanceParams$1;
3339
3378
 
3379
+ /**
3380
+ * Event allowed parameters.
3381
+ *
3382
+ * @interface ViewPromotionParams
3383
+ * @since 0.1.0
3384
+ * @extends GoogleAnalyticsCommonEventParams
3385
+ * @extends GoogleAnalyticsCustomEventParams
3386
+ */
3387
+ interface ViewPromotionParams$3 extends GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams {
3388
+ promotionId?: string;
3389
+ promotionName?: string;
3390
+ creativeName?: string;
3391
+ creativeSlot?: string;
3392
+ originalItem?: Gtag.Item;
3393
+ }
3394
+
3395
+ /**
3396
+ * Event allowed parameters.
3397
+ *
3398
+ * @interface ViewPromotionParams
3399
+ * @since 0.1.0
3400
+ * @extends FacebookPixelCommonEventParams
3401
+ * @extends FacebookPixelCustomEventParams
3402
+ */
3403
+ interface ViewPromotionParams$2 extends FacebookPixelCommonEventParams, FacebookPixelCustomEventParams {
3404
+ }
3405
+
3406
+ /**
3407
+ * Event allowed parameters.
3408
+ *
3409
+ * @interface ViewPromotionParams
3410
+ * @since 0.1.0
3411
+ * @extends SegmentCommonEventParams
3412
+ * @extends SegmentCustomEventParams
3413
+ * @extends ViewPromotionCommonParams
3414
+ */
3415
+ interface ViewPromotionParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, ViewPromotionCommonParams {
3416
+ }
3417
+
3418
+ /**
3419
+ * viewPromotion event interface
3420
+ *
3421
+ * @interface ViewPromotionCommonParams
3422
+ * @since 0.1.0
3423
+ */
3424
+ interface ViewPromotionCommonParams {
3425
+ }
3426
+ /**
3427
+ * viewPromotion event params.
3428
+ *
3429
+ * @typedef ViewPromotionParams
3430
+ * @since 0.1.0
3431
+ */
3432
+ type ViewPromotionParams = ViewPromotionParams$3 & ViewPromotionParams$2 & ViewPromotionParams$1;
3433
+
3434
+ /**
3435
+ * Event allowed parameters.
3436
+ *
3437
+ * @interface SelectPromotionParams
3438
+ * @since 0.1.0
3439
+ * @extends GoogleAnalyticsCommonEventParams
3440
+ * @extends GoogleAnalyticsCustomEventParams
3441
+ */
3442
+ interface SelectPromotionParams$3 extends GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams {
3443
+ promotionId?: string;
3444
+ promotionName?: string;
3445
+ creativeName?: string;
3446
+ creativeSlot?: string;
3447
+ originalItem?: Gtag.Item;
3448
+ }
3449
+
3450
+ /**
3451
+ * Event allowed parameters.
3452
+ *
3453
+ * @interface SelectPromotionParams
3454
+ * @since 0.1.0
3455
+ * @extends FacebookPixelCommonEventParams
3456
+ * @extends FacebookPixelCustomEventParams
3457
+ */
3458
+ interface SelectPromotionParams$2 extends FacebookPixelCommonEventParams, FacebookPixelCustomEventParams {
3459
+ }
3460
+
3461
+ /**
3462
+ * Event allowed parameters.
3463
+ *
3464
+ * @interface SelectPromotionParams
3465
+ * @since 0.1.0
3466
+ * @extends SegmentCommonEventParams
3467
+ * @extends SegmentCustomEventParams
3468
+ * @extends SelectPromotionCommonParams
3469
+ */
3470
+ interface SelectPromotionParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, SelectPromotionCommonParams {
3471
+ }
3472
+
3473
+ /**
3474
+ * selectPromotion event interface
3475
+ *
3476
+ * @interface SelectPromotionCommonParams
3477
+ * @since 0.1.0
3478
+ */
3479
+ interface SelectPromotionCommonParams {
3480
+ }
3481
+ /**
3482
+ * selectItem event params.
3483
+ *
3484
+ * @typedef SelectPromotionParams
3485
+ * @since 0.1.0
3486
+ */
3487
+ type SelectPromotionParams = SelectPromotionParams$3 & SelectPromotionParams$2 & SelectPromotionParams$1;
3488
+
3489
+ /**
3490
+ * Event allowed parameters.
3491
+ *
3492
+ * @interface SelectItemParams
3493
+ * @since 0.1.0
3494
+ * @extends GoogleAnalyticsCommonEventParams
3495
+ * @extends GoogleAnalyticsCustomEventParams
3496
+ */
3497
+ interface ViewItemListParams$3 extends GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams {
3498
+ }
3499
+
3500
+ /**
3501
+ * Event allowed parameters.
3502
+ *
3503
+ * @interface ViewItemListParams
3504
+ * @since 0.1.0
3505
+ * @extends FacebookPixelCommonEventParams
3506
+ * @extends FacebookPixelCustomEventParams
3507
+ */
3508
+ interface ViewItemListParams$2 extends FacebookPixelCommonEventParams, FacebookPixelCustomEventParams {
3509
+ }
3510
+
3511
+ /**
3512
+ * Event allowed parameters.
3513
+ *
3514
+ * @interface ViewItemListParams
3515
+ * @since 0.1.0
3516
+ * @extends SegmentCommonEventParams
3517
+ * @extends SegmentCustomEventParams
3518
+ * @extends ViewItemListCommonParams
3519
+ */
3520
+ interface ViewItemListParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, ViewItemListCommonParams {
3521
+ }
3522
+
3523
+ /**
3524
+ * viewItemList event interface
3525
+ *
3526
+ * @interface ViewItemListCommonParams
3527
+ * @since 0.1.0
3528
+ */
3529
+ interface ViewItemListCommonParams {
3530
+ }
3531
+ /**
3532
+ * selectItem event params.
3533
+ *
3534
+ * @typedef ViewItemListParams
3535
+ * @since 0.1.0
3536
+ */
3537
+ type ViewItemListParams = ViewItemListParams$3 & ViewItemListParams$2 & ViewItemListParams$1;
3538
+
3539
+ /**
3540
+ * Event allowed parameters.
3541
+ *
3542
+ * @interface SelectItemParams
3543
+ * @since 0.1.0
3544
+ * @extends GoogleAnalyticsCommonEventParams
3545
+ * @extends GoogleAnalyticsCustomEventParams
3546
+ */
3547
+ interface SelectItemParams$3 extends GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams {
3548
+ item?: Gtag.Item;
3549
+ list?: string;
3550
+ }
3551
+
3552
+ /**
3553
+ * Event allowed parameters.
3554
+ *
3555
+ * @interface SetLocationParams
3556
+ * @since 0.1.0
3557
+ * @extends FacebookPixelCommonEventParams
3558
+ * @extends FacebookPixelCustomEventParams
3559
+ * @extends SetLocationCommonParams
3560
+ */
3561
+ interface SelectItemParams$2 extends FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, SelectItemCommonParams {
3562
+ }
3563
+
3564
+ /**
3565
+ * Event allowed parameters.
3566
+ *
3567
+ * @interface SelectItemParams
3568
+ * @since 0.1.0
3569
+ * @extends SegmentCommonEventParams
3570
+ * @extends SegmentCustomEventParams
3571
+ * @extends SelectItemCommonParams
3572
+ */
3573
+ interface SelectItemParams$1 extends SegmentCommonEventParams, SegmentCustomEventParams, SelectItemCommonParams {
3574
+ }
3575
+
3576
+ /**
3577
+ * selectItem event interface
3578
+ *
3579
+ * @interface SelectItemCommonParams
3580
+ * @since 0.1.0
3581
+ */
3582
+ interface SelectItemCommonParams {
3583
+ }
3584
+ /**
3585
+ * selectItem event params.
3586
+ *
3587
+ * @typedef SelectItemParams
3588
+ * @since 0.1.0
3589
+ */
3590
+ type SelectItemParams = SelectItemParams$3 & SelectItemParams$2 & SelectItemParams$1;
3591
+
3340
3592
  /**
3341
3593
  * Event allowed parameters.
3342
3594
  *
@@ -5384,6 +5636,12 @@ declare const events: {
5384
5636
  logOutOfCoverage: (params?: OutOfCoverageParams) => void;
5385
5637
  logSetLocation: (params?: SetLocationParams) => void;
5386
5638
  };
5639
+ global: {
5640
+ logSelectItem: (params?: SelectItemParams) => void;
5641
+ logViewItemList: (params?: ViewItemListParams) => void;
5642
+ logSelectPromotion: (params?: SelectPromotionParams) => void;
5643
+ logViewPromotion: (params?: ViewPromotionParams) => void;
5644
+ };
5387
5645
  help: {
5388
5646
  logRequestAssistance: (params: RequestAssistanceParams) => void;
5389
5647
  };
@@ -5472,5 +5730,7 @@ declare const events: {
5472
5730
  */
5473
5731
  declare const updateActiveVendor: (vendor: Vendor | Vendor["id"] | -1 | undefined) => void;
5474
5732
 
5475
- export { Gtag, Providers, events, initAnalytics, updateActiveVendor };
5476
- export type { AnalyticsMeta, AuthProviderMethods, FacebookConversionsApiConfig, FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, FacebookPixelProvider, FacebookPixelProviderConfig, GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams, GoogleAnalyticsProvider, GoogleAnalyticsProviderConfig, InitAnalyticsConfig, InitAnalyticsConfigMeta, SupportedProviders };
5733
+ declare const toItemProduct: (product: CartProduct) => Gtag.Item[];
5734
+
5735
+ export { Gtag, Providers, events, initAnalytics, toItemProduct, updateActiveVendor };
5736
+ export type { AnalyticsMeta, AuthProviderMethods, FacebookConversionsApiConfig, FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, FacebookPixelProvider, FacebookPixelProviderConfig, GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams, GoogleAnalyticsProvider, GoogleAnalyticsProviderConfig, InitAnalyticsConfig, InitAnalyticsConfigMeta, SupportedProviders, UserProperties };