@artisan-commerce/analytics-capacitor 0.1.0-canary.2 → 0.1.0-canary.20
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/bundle.cjs.js +3524 -1345
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.d.ts +56 -4
- package/dist/bundle.esm.js +3478 -1299
- package/dist/bundle.esm.js.map +1 -1
- package/dist/bundle.umd.js +3525 -1347
- package/dist/bundle.umd.js.map +1 -1
- package/package.json +10 -16
package/dist/bundle.d.ts
CHANGED
|
@@ -432,9 +432,44 @@ interface FacebookPixelProvider extends Omit<AnalyticsProviderConstructor, "type
|
|
|
432
432
|
* @interface FacebookPixelProvider
|
|
433
433
|
* @since 0.5.14
|
|
434
434
|
* @property {CurrencyCodes} currency user's country monetary code
|
|
435
|
+
* @property {boolean} isTrackingAllowed whether user tracking is allowed
|
|
436
|
+
* @property {boolean} withConversionsAPI whether conversion API feature is allowed
|
|
437
|
+
* @property {FacebookConversionsApiConfig} conversionsApiConfig facebook conversions API configuration
|
|
438
|
+
* @property {boolean} advertiserTrackingEnabled whether advertiser tracking enabled
|
|
439
|
+
* @property {boolean} applicationTrackingEnabled whether application
|
|
435
440
|
*/
|
|
436
441
|
interface FacebookPixelProviderConfig {
|
|
437
442
|
currency?: CurrencyCodes;
|
|
443
|
+
isTrackingAllowed?: boolean;
|
|
444
|
+
withConversionsAPI?: boolean;
|
|
445
|
+
conversionsApiConfig?: FacebookConversionsApiConfig;
|
|
446
|
+
advertiserTrackingEnabled?: boolean;
|
|
447
|
+
applicationTrackingEnabled?: boolean;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Facebook Conversions API configuration.
|
|
451
|
+
*
|
|
452
|
+
* @interface FacebookConversionsApiConfig
|
|
453
|
+
* @since 0.1.0
|
|
454
|
+
* @implements FacebookPixelProviderConfig
|
|
455
|
+
* @property {string} eventSourceUrl website url
|
|
456
|
+
* @property {string} countryISOCode user's country ISO code in lowercase (e.g. "ec")
|
|
457
|
+
* @property {string} fbAccessToken Facebook pixel token
|
|
458
|
+
* @property {string} fbDataSourceId Facebook pixel or dataset id
|
|
459
|
+
* @property {string} apiURL api URL
|
|
460
|
+
* @property {string} authToken user's authorization token
|
|
461
|
+
* @property {boolean} advertiserTrackingEnabled whether advertiser tracking enabled
|
|
462
|
+
* @property {boolean} applicationTrackingEnabled whether application tracking enabled
|
|
463
|
+
*/
|
|
464
|
+
interface FacebookConversionsApiConfig {
|
|
465
|
+
eventSourceUrl?: string;
|
|
466
|
+
countryISOCode: string;
|
|
467
|
+
fbAccessToken: string;
|
|
468
|
+
fbDataSourceId: string;
|
|
469
|
+
apiURL: string;
|
|
470
|
+
authToken: string;
|
|
471
|
+
advertiserTrackingEnabled?: boolean;
|
|
472
|
+
applicationTrackingEnabled?: boolean;
|
|
438
473
|
}
|
|
439
474
|
/**
|
|
440
475
|
* Facebook Pixel event shared parameters.
|
|
@@ -469,19 +504,25 @@ declare namespace Fbq {
|
|
|
469
504
|
currency?: string;
|
|
470
505
|
value?: number;
|
|
471
506
|
}
|
|
507
|
+
interface Product {
|
|
508
|
+
id?: string;
|
|
509
|
+
quantity?: number;
|
|
510
|
+
item_price?: number;
|
|
511
|
+
delivery_category?: string;
|
|
512
|
+
}
|
|
472
513
|
}
|
|
473
514
|
|
|
474
515
|
/**
|
|
475
516
|
* Analytics providers configurable options.
|
|
476
517
|
*
|
|
477
|
-
* @typedef
|
|
518
|
+
* @typedef AnalyticsProvidersConfigs
|
|
478
519
|
* @since 0.5.14
|
|
479
520
|
*/
|
|
480
521
|
declare type AnalyticsProvidersConfigs = Partial<GoogleAnalyticsProviderConfig> | Partial<FacebookPixelProviderConfig>;
|
|
481
522
|
/**
|
|
482
523
|
* Analytics event metadata to be included in every sent event.
|
|
483
524
|
*
|
|
484
|
-
* @interface
|
|
525
|
+
* @interface AnalyticsMeta
|
|
485
526
|
* @since 0.5.14
|
|
486
527
|
* @property {number} accountId the id of the account it is running on
|
|
487
528
|
* @property {number} vendorId the id of the active vendor
|
|
@@ -606,8 +647,13 @@ declare abstract class AnalyticsProvider implements IAnaliticsProvider {
|
|
|
606
647
|
declare class FacebookPixel extends AnalyticsProvider {
|
|
607
648
|
private readonly _version;
|
|
608
649
|
private _currency;
|
|
650
|
+
private _isTrackingAllowed;
|
|
651
|
+
private _conversionsApiConfig;
|
|
652
|
+
readonly withConversionsAPI: FacebookPixelProvider["withConversionsAPI"];
|
|
653
|
+
private _advertiserTrackingEnabled;
|
|
654
|
+
private _applicationTrackingEnabled;
|
|
609
655
|
/**
|
|
610
|
-
*
|
|
656
|
+
* Constructs a Facebook Pixel Provider
|
|
611
657
|
*
|
|
612
658
|
* @constructs
|
|
613
659
|
* @since 0.5.14
|
|
@@ -616,6 +662,10 @@ declare class FacebookPixel extends AnalyticsProvider {
|
|
|
616
662
|
constructor(config: FacebookPixelProvider);
|
|
617
663
|
get version(): FacebookPixelProvider["version"];
|
|
618
664
|
get currency(): FacebookPixelProvider["currency"];
|
|
665
|
+
get isTrackingAllowed(): FacebookPixelProvider["isTrackingAllowed"];
|
|
666
|
+
get conversionsApiConfig(): FacebookPixelProvider["conversionsApiConfig"];
|
|
667
|
+
get advertiserTrackingEnabled(): FacebookPixelProvider["advertiserTrackingEnabled"];
|
|
668
|
+
get applicationTrackingEnabled(): FacebookPixelProvider["applicationTrackingEnabled"];
|
|
619
669
|
/**
|
|
620
670
|
* @override
|
|
621
671
|
* @since 0.5.14
|
|
@@ -711,6 +761,7 @@ declare const Providers: {
|
|
|
711
761
|
* @property {boolean} debug Debug mode
|
|
712
762
|
* @property {boolean} shareArtisnAnalytics Share e-commerce analytics with Trade
|
|
713
763
|
* @property {InitAnalyticsConfigMeta} meta Commerce's metadata
|
|
764
|
+
* @property {function} onInit fires the callback once analytics are initialized
|
|
714
765
|
*/
|
|
715
766
|
interface InitAnalyticsConfig {
|
|
716
767
|
providers: AnalyticsProviderTypes[];
|
|
@@ -719,6 +770,7 @@ interface InitAnalyticsConfig {
|
|
|
719
770
|
debug?: boolean;
|
|
720
771
|
shareArtisnAnalytics?: boolean;
|
|
721
772
|
meta: InitAnalyticsConfigMeta;
|
|
773
|
+
onInit?: () => void;
|
|
722
774
|
}
|
|
723
775
|
/**
|
|
724
776
|
* Commerce's metadata
|
|
@@ -5744,4 +5796,4 @@ declare const identifyUser: (identify: Segment$1.Traits) => void;
|
|
|
5744
5796
|
*/
|
|
5745
5797
|
declare const checkInit: () => boolean;
|
|
5746
5798
|
|
|
5747
|
-
export { AnalyticsMeta, AnalyticsProvidersConfigs, AuthProviderMethods, FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, FacebookPixelProvider, FacebookPixelProviderConfig, Fbq, GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams, GoogleAnalyticsProvider, GoogleAnalyticsProviderConfig, Gtag, InitAnalyticsConfig, InitAnalyticsConfigMeta, Providers, Segment$1 as Segment, SegmentCommonEventParams, SegmentCustomEventParams, SegmentProvider, SegmentProviderConfig, SupportedProviders, checkInit, events, identifyUser, initAnalytics, updateActiveVendor };
|
|
5799
|
+
export { AnalyticsMeta, AnalyticsProvidersConfigs, AuthProviderMethods, FacebookConversionsApiConfig, FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, FacebookPixelProvider, FacebookPixelProviderConfig, Fbq, GoogleAnalyticsCommonEventParams, GoogleAnalyticsCustomEventParams, GoogleAnalyticsProvider, GoogleAnalyticsProviderConfig, Gtag, InitAnalyticsConfig, InitAnalyticsConfigMeta, Providers, Segment$1 as Segment, SegmentCommonEventParams, SegmentCustomEventParams, SegmentProvider, SegmentProviderConfig, SupportedProviders, checkInit, events, identifyUser, initAnalytics, updateActiveVendor };
|