@artisan-commerce/analytics-rn 0.2.0-canary.1 → 0.2.0-canary.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.
- package/CHANGELOG.md +77 -0
- package/build/analytics-rn/src/index.d.ts +4 -0
- package/build/analytics-rn/src/lib/events/customEvent/customEvent.types.d.ts +1 -1
- package/build/analytics-rn/src/lib/events/other/screenView/screenView.d.ts +1 -2
- package/build/analytics-rn/src/lib/initAnalytics/initAnalytics.types.d.ts +1 -1
- package/build/analytics-rn/src/lib/providers/AnalyticsProvider/AnalyticsProvider.d.ts +1 -1
- package/build/analytics-rn/src/lib/providers/AnalyticsProvider/AnalyticsProvider.types.d.ts +2 -2
- package/build/analytics-rn/src/lib/providers/FacebookPixel/FacebookPixel.types.d.ts +0 -16
- package/build/analytics-rn/src/lib/providers/GoogleAnalytics/GoogleAnalytics.types.d.ts +0 -46
- package/build/analytics-rn/src/test/exports.test.d.ts +1 -0
- package/build/analytics-rn/src/utils/state.utils.d.ts +8 -0
- package/build/main.bundle.js +11 -11
- package/build/report.json +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,83 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.2.0-canary.10](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.9...@artisan-commerce/analytics-rn@0.2.0-canary.10) (2021-05-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @artisan-commerce/analytics-rn
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.2.0-canary.9](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.8...@artisan-commerce/analytics-rn@0.2.0-canary.9) (2021-04-27)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **global:** fix updateActiveVendor utility function and state lib ([e5d9c52](https://bitbucket.org/tradesystem/artisan_monorepo/commit/e5d9c52455929782ada1762b03abb3363efe88cf))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [0.2.0-canary.8](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.7...@artisan-commerce/analytics-rn@0.2.0-canary.8) (2021-04-23)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **analytics-rn:** expose util function to update active vendor ([4247982](https://bitbucket.org/tradesystem/artisan_monorepo/commit/4247982bfd6bec52db7dc28f32cd06821b724909))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## [0.2.0-canary.7](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.6...@artisan-commerce/analytics-rn@0.2.0-canary.7) (2021-04-22)
|
|
33
|
+
|
|
34
|
+
**Note:** Version bump only for package @artisan-commerce/analytics-rn
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## [0.2.0-canary.6](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.5...@artisan-commerce/analytics-rn@0.2.0-canary.6) (2021-04-21)
|
|
41
|
+
|
|
42
|
+
**Note:** Version bump only for package @artisan-commerce/analytics-rn
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## [0.2.0-canary.5](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.4...@artisan-commerce/analytics-rn@0.2.0-canary.5) (2021-04-20)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
* **analytics-rn:** remove unused event parameter for google events ([2d76e14](https://bitbucket.org/tradesystem/artisan_monorepo/commit/2d76e1498ac4a86fe4b4172a3f5f35b39a69542f))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [0.2.0-canary.4](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.3...@artisan-commerce/analytics-rn@0.2.0-canary.4) (2021-04-19)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @artisan-commerce/analytics-rn
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [0.2.0-canary.3](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.2...@artisan-commerce/analytics-rn@0.2.0-canary.3) (2021-04-16)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Bug Fixes
|
|
69
|
+
|
|
70
|
+
* **analytics-rn:** fix purchaseAttempt and purchaseFail events parameters ([a2ab693](https://bitbucket.org/tradesystem/artisan_monorepo/commit/a2ab693622c284ca4712fa8bd80e133636efb34a))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## [0.2.0-canary.2](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.1...@artisan-commerce/analytics-rn@0.2.0-canary.2) (2021-04-16)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
* **global:** fix spendPoints google name event and update husky ([42adffb](https://bitbucket.org/tradesystem/artisan_monorepo/commit/42adffb8594780f9dc56c475ac2fe29ca5f9270a))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
6
83
|
## [0.2.0-canary.1](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.0...@artisan-commerce/analytics-rn@0.2.0-canary.1) (2021-04-16)
|
|
7
84
|
|
|
8
85
|
**Note:** Version bump only for package @artisan-commerce/analytics-rn
|
|
@@ -6,3 +6,7 @@ export * from "./lib/providers/FacebookPixel/FacebookPixel.types";
|
|
|
6
6
|
export * from "./lib/providers/GoogleAnalytics/GoogleAnalytics.types";
|
|
7
7
|
export { default as events } from "./lib/events/events";
|
|
8
8
|
export * from "./types/common.types";
|
|
9
|
+
export { updateActiveVendor } from "./utils/state.utils";
|
|
10
|
+
export declare const utils: {
|
|
11
|
+
getState: () => import("./types/state.types").GlobalState;
|
|
12
|
+
};
|
|
@@ -7,7 +7,7 @@ import { CustomEventParams as FacebookCustomEventParams } from "../../providers/
|
|
|
7
7
|
* @since 0.5.14
|
|
8
8
|
*/
|
|
9
9
|
export interface CustomEventCommonParams {
|
|
10
|
-
[key: string]: string | number
|
|
10
|
+
[key: string]: string | number;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* customEvent event params.
|
|
@@ -2,8 +2,7 @@ import { ScreenViewParams } from "./screenView.types";
|
|
|
2
2
|
/**
|
|
3
3
|
* Emits a screenView event to every configured provider.
|
|
4
4
|
*
|
|
5
|
-
* Log this event when
|
|
6
|
-
* view event does not log.
|
|
5
|
+
* Log this event when for each visited screen.
|
|
7
6
|
*
|
|
8
7
|
* @since 0.5.14
|
|
9
8
|
* @param {ScreenViewParams} params ScreenView event parameters
|
|
@@ -3,7 +3,7 @@ import { AnalyticsMeta } from "../../types/common.types";
|
|
|
3
3
|
export interface InitAnalyticsConfig {
|
|
4
4
|
providers: any[];
|
|
5
5
|
activeVendor?: Vendor["id"];
|
|
6
|
-
vendors: Vendor["id"][];
|
|
6
|
+
vendors: Vendor["id"][] | undefined;
|
|
7
7
|
debug?: boolean;
|
|
8
8
|
meta: InitAnalyticsConfigMeta;
|
|
9
9
|
}
|
|
@@ -24,7 +24,7 @@ declare abstract class AnalyticsProvider implements IAnaliticsProvider {
|
|
|
24
24
|
* @since 0.5.14
|
|
25
25
|
* @returns Analytics Provider vendors, if not specified it fallsback to the global vendors
|
|
26
26
|
*/
|
|
27
|
-
get vendors(): number[];
|
|
27
|
+
get vendors(): number[] | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Updates the provider instance config for the next events.
|
|
30
30
|
*
|
|
@@ -20,9 +20,9 @@ export interface AnalyticsProviderConstructor {
|
|
|
20
20
|
* @interface IAnaliticsProvider
|
|
21
21
|
* @since 0.5.14
|
|
22
22
|
* @property {Function} updateConfig Updates the initial config of the provider
|
|
23
|
-
* @property {
|
|
23
|
+
* @property {number[]} vendors The provider selected vendors ids
|
|
24
24
|
*/
|
|
25
25
|
export interface IAnaliticsProvider {
|
|
26
26
|
updateConfig: (config: Partial<unknown>) => void;
|
|
27
|
-
vendors: Vendor["id"][];
|
|
27
|
+
vendors: Vendor["id"][] | undefined;
|
|
28
28
|
}
|
|
@@ -40,19 +40,3 @@ export interface FacebookPixelCommonEventParams extends EventCommonParams {
|
|
|
40
40
|
export interface FacebookPixelCustomEventParams {
|
|
41
41
|
[key: string]: any;
|
|
42
42
|
}
|
|
43
|
-
export declare namespace Fbq {
|
|
44
|
-
interface Fbq {
|
|
45
|
-
(command: "trackSingle", targetId: string, eventName: EventNames, eventParams?: ControlParams | EventParams | CustomParams): void;
|
|
46
|
-
(command: "trackSingleCustom", targetId: string, eventName: string, eventParams?: ControlParams | EventParams | CustomParams): void;
|
|
47
|
-
}
|
|
48
|
-
interface CustomParams {
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}
|
|
51
|
-
interface ControlParams {
|
|
52
|
-
}
|
|
53
|
-
type EventNames = "ScreenView" | "CompleteRegistration" | "FindLocation" | "Search" | "CustomizeProduct" | "InitiateCheckout" | "AddPaymentInfo" | "Schedule" | "Purchase" | "Lead" | "AddToCart" | "AddToWishlist" | "Contact";
|
|
54
|
-
interface EventParams {
|
|
55
|
-
currency?: string;
|
|
56
|
-
value?: number;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -33,10 +33,8 @@ export interface GoogleAnalyticsProviderConfig {
|
|
|
33
33
|
* @interface GoogleAnalyticsCommonEventParams
|
|
34
34
|
* @since 0.5.14
|
|
35
35
|
* @extends EventCommonParams
|
|
36
|
-
* @property {Function} callback Fired when event is resolved
|
|
37
36
|
*/
|
|
38
37
|
export interface GoogleAnalyticsCommonEventParams extends EventCommonParams {
|
|
39
|
-
callback?: () => void;
|
|
40
38
|
}
|
|
41
39
|
/**
|
|
42
40
|
* Google Analytics custom event shared parameters.
|
|
@@ -48,44 +46,6 @@ export interface GoogleAnalyticsCustomEventParams {
|
|
|
48
46
|
[key: string]: any;
|
|
49
47
|
}
|
|
50
48
|
export declare namespace Gtag {
|
|
51
|
-
interface Gtag {
|
|
52
|
-
(command: "config", targetId: string, config?: ControlParams | EventParams | CustomParams): void;
|
|
53
|
-
(command: "get", targetId: string, fieldName: string, callback: (field: unknown) => void): void;
|
|
54
|
-
(command: "set", targetId: string, config: CustomParams): void;
|
|
55
|
-
(command: "event", eventName: EventNames | string, eventParams?: ControlParams | EventParams | CustomParams): void;
|
|
56
|
-
}
|
|
57
|
-
interface CustomParams {
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
}
|
|
60
|
-
interface ControlParams {
|
|
61
|
-
groups?: string | string[];
|
|
62
|
-
send_to: string | string[];
|
|
63
|
-
event_callback?: () => void;
|
|
64
|
-
event_timeout?: number;
|
|
65
|
-
}
|
|
66
|
-
type EventNames = "add_payment_info" | "add_to_cart" | "add_to_wishlist" | "begin_checkout" | "earn_virtual_currency" | "exception" | "generate_lead" | "login" | "page_view" | "purchase" | "refund" | "remove_from_cart" | "screen_view" | "search" | "select_content" | "set_checkout_option" | "share" | "sign_up" | "timing_complete" | "view_item" | "view_item_list" | "view_promotion" | "view_search_results";
|
|
67
|
-
interface EventParams {
|
|
68
|
-
checkout_option?: string;
|
|
69
|
-
checkout_step?: number;
|
|
70
|
-
content_id?: string;
|
|
71
|
-
content_type?: string;
|
|
72
|
-
coupon?: string;
|
|
73
|
-
currency?: string;
|
|
74
|
-
description?: string;
|
|
75
|
-
fatal?: boolean;
|
|
76
|
-
items?: Item[];
|
|
77
|
-
method?: string;
|
|
78
|
-
number?: string;
|
|
79
|
-
promotions?: Promotion[];
|
|
80
|
-
screen_name?: string;
|
|
81
|
-
search_term?: string;
|
|
82
|
-
shipping?: Currency;
|
|
83
|
-
tax?: Currency;
|
|
84
|
-
transaction_id?: string;
|
|
85
|
-
value?: number;
|
|
86
|
-
event_label?: string;
|
|
87
|
-
event_category?: string;
|
|
88
|
-
}
|
|
89
49
|
type Currency = string | number;
|
|
90
50
|
interface Item {
|
|
91
51
|
brand?: string;
|
|
@@ -105,10 +65,4 @@ export declare namespace Gtag {
|
|
|
105
65
|
price?: Currency;
|
|
106
66
|
quantity?: number;
|
|
107
67
|
}
|
|
108
|
-
interface Promotion {
|
|
109
|
-
creative_name?: string;
|
|
110
|
-
creative_slot?: string;
|
|
111
|
-
id?: string;
|
|
112
|
-
name?: string;
|
|
113
|
-
}
|
|
114
68
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { GlobalState } from "../types/state.types";
|
|
2
|
+
import { Vendor } from "@artisan-commerce/types";
|
|
2
3
|
export declare const setInitialState: () => void;
|
|
3
4
|
export declare const getState: () => GlobalState;
|
|
4
5
|
export declare const setState: (state: Partial<GlobalState>) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Utility function to update the active vendor.
|
|
8
|
+
*
|
|
9
|
+
* @since 0.5.14
|
|
10
|
+
* @param {Vendor|number} vendor New active vendor
|
|
11
|
+
*/
|
|
12
|
+
export declare const updateActiveVendor: (vendor: Vendor | Vendor["id"]) => void;
|