@chordcommerce/analytics 1.8.0 → 1.9.1
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/README.md +17 -14
- package/dist/client/cdp.d.ts +3 -0
- package/dist/client/cdp.js +28 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +108 -76
- package/dist/types/client.d.ts +10 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
The `@chordcommerce/analytics` library provides simple methods for sending tracking events to Chord from your website, with an optional debugging mode to validate event properties.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Visit [docs.chord.co](https://docs.chord.co/analytics-getting-started) for guides, examples, and an API reference.
|
|
5
|
+
Visit [docs.chord.co](https://docs.chord.co/installing-chord-analytics) for guides, examples, and an API reference.
|
|
8
6
|
|
|
9
7
|
## Requirements
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
The library supports sending events via Chord CDP or Segment. If using Segment, [analytics.js](https://www.npmjs.com/package/@segment/analytics-next) must also be installed in your project.
|
|
12
10
|
|
|
13
11
|
## Installation
|
|
14
12
|
|
|
@@ -22,7 +20,7 @@ yarn add @chordcommerce/analytics
|
|
|
22
20
|
|
|
23
21
|
## Usage
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
Initialize `@chordcommerce/analytics` as follows:
|
|
26
24
|
|
|
27
25
|
```jsx
|
|
28
26
|
import ChordAnalytics from '@chordcommerce/analytics'
|
|
@@ -36,14 +34,19 @@ chord.trackCartViewed({ cart }) // sends a "Cart Viewed" event to the CDP
|
|
|
36
34
|
|
|
37
35
|
`@chordcommerce/analytics` can be initialized with the following options:
|
|
38
36
|
|
|
39
|
-
| Property | Required | Description
|
|
40
|
-
| --------------- | -------- |
|
|
41
|
-
| `cdp` |
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
37
|
+
| Property | Required | Description |
|
|
38
|
+
| --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
|
+
| `cdp` | false | _Required when using a CDP other than Chord._ A reference to the CDP library, or a function that returns a reference to the CDP library. For example, if using Segment's [analytics.js](https://www.npmjs.com/package/@segment/analytics-next) library, this could be `window.analytics` or `() => window.analytics`. |
|
|
40
|
+
| `cdpDomain` | false | _Required when using Chord CDP._ The Chord CDP domain. To be provided by the Chord team. |
|
|
41
|
+
| `cdpWriteKey` | false | _Required when using Chord CDP._ The Chord CDP write key. To be provided by the Chord team. |
|
|
42
|
+
| `debug` | false | Defaults to `false`. When set to `true`, events are validated against Chord's tracking plan and errors are logged. We recommend enabling this for development and disabling for production. |
|
|
43
|
+
| `enableLogging` | false | Defaults to `true`. When set to `true`, errors are logged using `console.log`. |
|
|
44
|
+
| `formatters` | true | Functions that are used to construct tracking events. There are two types of formatters, objects and events. `formatters.objects` is required. See below for details. |
|
|
45
|
+
| `metadata` | true | Event metadata. See below for details. |
|
|
46
|
+
| `namespace` | false | Defaults to `chord`. Changes where Chord is globally available (e.g. `window.chord`). _Only applicable when using Chord CDP._ |
|
|
47
|
+
| `stripNull` | false | Defaults to `true`. When set to `true`, event properties with a `null` value are removed. CDPs typically treat `null` and `undefined` as separate values, so be sure you intend to send `null` values before setting to false. |
|
|
48
|
+
|
|
49
|
+
If `cdp`, `cdpDomain`, and `cdpWriteKey` are all omitted, no tracking events are sent.
|
|
47
50
|
|
|
48
51
|
**Metadata**
|
|
49
52
|
|
|
@@ -109,7 +112,7 @@ export const cartFormatter: CartFormatter<StorefrontCart> = (props) => {
|
|
|
109
112
|
|
|
110
113
|
## API Reference
|
|
111
114
|
|
|
112
|
-
See [Chord’s documentation](https://docs.chord.co/
|
|
115
|
+
See [Chord’s documentation](https://docs.chord.co/api-reference) for a full API reference.
|
|
113
116
|
|
|
114
117
|
## Support
|
|
115
118
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Adds the Chord CDP snippet to the page.
|
|
3
|
+
*/
|
|
4
|
+
export const addCdpSnippet = (options) => {
|
|
5
|
+
if (!document || typeof document.createElement === 'undefined')
|
|
6
|
+
return;
|
|
7
|
+
const s = document.createElement('script');
|
|
8
|
+
s.async = true;
|
|
9
|
+
s.src = `${options.cdpDomain}/p.js`;
|
|
10
|
+
s.setAttribute('data-debug', `${!!options.debug}`);
|
|
11
|
+
s.setAttribute('data-init-only', 'true');
|
|
12
|
+
s.setAttribute('data-namespace', `_${options.namespace}`);
|
|
13
|
+
s.setAttribute('data-write-key', options.cdpWriteKey);
|
|
14
|
+
document.head.appendChild(s);
|
|
15
|
+
};
|
|
16
|
+
/*
|
|
17
|
+
* Returns the CDP queue to hold events ahead of CDP initialization.
|
|
18
|
+
*/
|
|
19
|
+
export const cdpQueue = (namespace) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const q = window && (window[_a = `_${namespace}Q`] || (window[_a] = []));
|
|
22
|
+
return {
|
|
23
|
+
track: (...args) => q.push((cdp) => cdp.track(...args)),
|
|
24
|
+
identify: (...args) => q.push((cdp) => cdp.identify(...args)),
|
|
25
|
+
page: (...args) => q.push((cdp) => cdp.page(...args)),
|
|
26
|
+
reset: (...args) => q.push((cdp) => cdp.reset(...args)),
|
|
27
|
+
};
|
|
28
|
+
};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare class ChordAnalytics<T extends ObjectTypes = ObjectTypes> {
|
|
|
23
23
|
options: ChordAnalyticsOptions<T>;
|
|
24
24
|
constructor(options: ChordAnalyticsOptions<T>);
|
|
25
25
|
cdp: () => AnyAnalytics;
|
|
26
|
+
ccdp: () => AnyAnalytics;
|
|
26
27
|
logger: (message?: any, ...optionalParams: any[]) => void;
|
|
27
28
|
/**
|
|
28
29
|
* Validate the body of a `track` event against the Chord tracking plan.
|
package/dist/client/index.js
CHANGED
|
@@ -7,10 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { addCdpSnippet, cdpQueue } from './cdp.js';
|
|
10
11
|
import { eventSchemas } from '../validators/index.js';
|
|
11
12
|
import { pruneNullValues } from '../utils.js';
|
|
12
13
|
export class ChordAnalytics {
|
|
13
14
|
constructor(options) {
|
|
15
|
+
var _a, _b;
|
|
14
16
|
/**
|
|
15
17
|
* Allows snippet.js to detect whether this library has been initialized yet.
|
|
16
18
|
*/
|
|
@@ -29,6 +31,15 @@ export class ChordAnalytics {
|
|
|
29
31
|
return a();
|
|
30
32
|
return a;
|
|
31
33
|
};
|
|
34
|
+
/*
|
|
35
|
+
* Return the Chord CDP instance or queue.
|
|
36
|
+
*/
|
|
37
|
+
this.ccdp = () => {
|
|
38
|
+
const { cdpDomain, cdpWriteKey, namespace } = this.options;
|
|
39
|
+
if (!cdpDomain || !cdpWriteKey)
|
|
40
|
+
return null;
|
|
41
|
+
return (window === null || window === void 0 ? void 0 : window[`_${namespace}`]) || cdpQueue(namespace);
|
|
42
|
+
};
|
|
32
43
|
/*
|
|
33
44
|
* Log a message to the console if `options.enableLogging` is true.
|
|
34
45
|
*/
|
|
@@ -88,6 +99,10 @@ export class ChordAnalytics {
|
|
|
88
99
|
if (a && typeof a.track === 'function') {
|
|
89
100
|
a.track(event, finalEventProps, options, () => resolve());
|
|
90
101
|
}
|
|
102
|
+
const b = this.ccdp();
|
|
103
|
+
if (b && typeof b.track === 'function') {
|
|
104
|
+
b.track(event, finalEventProps, options, () => resolve());
|
|
105
|
+
}
|
|
91
106
|
}
|
|
92
107
|
catch (error) {
|
|
93
108
|
this.logger(error);
|
|
@@ -103,6 +118,10 @@ export class ChordAnalytics {
|
|
|
103
118
|
if (a && typeof a.identify === 'function') {
|
|
104
119
|
a.identify(...props);
|
|
105
120
|
}
|
|
121
|
+
const b = this.ccdp();
|
|
122
|
+
if (b && typeof b.identify === 'function') {
|
|
123
|
+
b.identify(...props);
|
|
124
|
+
}
|
|
106
125
|
}
|
|
107
126
|
catch (error) {
|
|
108
127
|
this.logger(error);
|
|
@@ -117,6 +136,10 @@ export class ChordAnalytics {
|
|
|
117
136
|
if (a && typeof a.page === 'function') {
|
|
118
137
|
a.page({ meta: this.meta() });
|
|
119
138
|
}
|
|
139
|
+
const b = this.ccdp();
|
|
140
|
+
if (b && typeof b.page === 'function') {
|
|
141
|
+
b.page({ meta: this.meta() });
|
|
142
|
+
}
|
|
120
143
|
}
|
|
121
144
|
catch (error) {
|
|
122
145
|
this.logger(error);
|
|
@@ -128,6 +151,10 @@ export class ChordAnalytics {
|
|
|
128
151
|
if (a && typeof a.reset === 'function') {
|
|
129
152
|
a.reset();
|
|
130
153
|
}
|
|
154
|
+
const b = this.ccdp();
|
|
155
|
+
if (b && typeof b.reset === 'function') {
|
|
156
|
+
b.reset();
|
|
157
|
+
}
|
|
131
158
|
}
|
|
132
159
|
catch (error) {
|
|
133
160
|
this.logger(error);
|
|
@@ -135,8 +162,8 @@ export class ChordAnalytics {
|
|
|
135
162
|
};
|
|
136
163
|
// TODO: Add support for props.products
|
|
137
164
|
this.trackCartViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
var
|
|
139
|
-
const cart = (
|
|
165
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
166
|
+
const cart = (_f = (_e = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.formatters) === null || _d === void 0 ? void 0 : _d.objects) === null || _e === void 0 ? void 0 : _e.cart) === null || _f === void 0 ? void 0 : _f.call(_e, {
|
|
140
167
|
cart: props === null || props === void 0 ? void 0 : props.cart,
|
|
141
168
|
});
|
|
142
169
|
const payload = {
|
|
@@ -145,17 +172,17 @@ export class ChordAnalytics {
|
|
|
145
172
|
products: cart === null || cart === void 0 ? void 0 : cart.products,
|
|
146
173
|
value: cart === null || cart === void 0 ? void 0 : cart.value,
|
|
147
174
|
};
|
|
148
|
-
if ((
|
|
149
|
-
const formattedPayload = (
|
|
175
|
+
if ((_j = (_h = (_g = this.options) === null || _g === void 0 ? void 0 : _g.formatters) === null || _h === void 0 ? void 0 : _h.events) === null || _j === void 0 ? void 0 : _j.cartViewed) {
|
|
176
|
+
const formattedPayload = (_m = (_l = (_k = this.options) === null || _k === void 0 ? void 0 : _k.formatters) === null || _l === void 0 ? void 0 : _l.events) === null || _m === void 0 ? void 0 : _m.cartViewed(props, payload);
|
|
150
177
|
return this.track('Cart Viewed', formattedPayload, options);
|
|
151
178
|
}
|
|
152
179
|
return this.track('Cart Viewed', payload, options);
|
|
153
180
|
});
|
|
154
181
|
// TODO: Add support for props.products
|
|
155
182
|
this.trackCheckoutStarted = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
156
|
-
var
|
|
157
|
-
const formatter = (
|
|
158
|
-
const checkout = (
|
|
183
|
+
var _o, _p, _q, _r, _s, _t, _u;
|
|
184
|
+
const formatter = (_q = (_p = (_o = this.options) === null || _o === void 0 ? void 0 : _o.formatters) === null || _p === void 0 ? void 0 : _p.events) === null || _q === void 0 ? void 0 : _q.checkoutStarted;
|
|
185
|
+
const checkout = (_u = (_t = (_s = (_r = this.options) === null || _r === void 0 ? void 0 : _r.formatters) === null || _s === void 0 ? void 0 : _s.objects) === null || _t === void 0 ? void 0 : _t.checkout) === null || _u === void 0 ? void 0 : _u.call(_t, {
|
|
159
186
|
checkout: props === null || props === void 0 ? void 0 : props.checkout,
|
|
160
187
|
});
|
|
161
188
|
const payload = checkout;
|
|
@@ -166,8 +193,8 @@ export class ChordAnalytics {
|
|
|
166
193
|
return this.track('Checkout Started', payload, options);
|
|
167
194
|
});
|
|
168
195
|
this.trackCheckoutStepCompleted = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
var
|
|
170
|
-
const formatter = (
|
|
196
|
+
var _v, _w, _x;
|
|
197
|
+
const formatter = (_x = (_w = (_v = this.options) === null || _v === void 0 ? void 0 : _v.formatters) === null || _w === void 0 ? void 0 : _w.events) === null || _x === void 0 ? void 0 : _x.checkoutStepCompleted;
|
|
171
198
|
const payload = {
|
|
172
199
|
checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
|
|
173
200
|
payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
|
|
@@ -181,8 +208,8 @@ export class ChordAnalytics {
|
|
|
181
208
|
return this.track('Checkout Step Completed', payload, options);
|
|
182
209
|
});
|
|
183
210
|
this.trackCheckoutStepViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
184
|
-
var
|
|
185
|
-
const formatter = (
|
|
211
|
+
var _y, _z, _0;
|
|
212
|
+
const formatter = (_0 = (_z = (_y = this.options) === null || _y === void 0 ? void 0 : _y.formatters) === null || _z === void 0 ? void 0 : _z.events) === null || _0 === void 0 ? void 0 : _0.checkoutStepViewed;
|
|
186
213
|
const payload = {
|
|
187
214
|
checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
|
|
188
215
|
payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
|
|
@@ -196,8 +223,8 @@ export class ChordAnalytics {
|
|
|
196
223
|
return this.track('Checkout Step Viewed', payload, options);
|
|
197
224
|
});
|
|
198
225
|
this.trackCouponApplied = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
199
|
-
var
|
|
200
|
-
const formatter = (
|
|
226
|
+
var _1, _2, _3;
|
|
227
|
+
const formatter = (_3 = (_2 = (_1 = this.options) === null || _1 === void 0 ? void 0 : _1.formatters) === null || _2 === void 0 ? void 0 : _2.events) === null || _3 === void 0 ? void 0 : _3.couponApplied;
|
|
201
228
|
const payload = {
|
|
202
229
|
cart_id: props === null || props === void 0 ? void 0 : props.cartId,
|
|
203
230
|
coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
|
|
@@ -212,8 +239,8 @@ export class ChordAnalytics {
|
|
|
212
239
|
return this.track('Coupon Applied', payload, options);
|
|
213
240
|
});
|
|
214
241
|
this.trackCouponDenied = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
215
|
-
var
|
|
216
|
-
const formatter = (
|
|
242
|
+
var _4, _5, _6;
|
|
243
|
+
const formatter = (_6 = (_5 = (_4 = this.options) === null || _4 === void 0 ? void 0 : _4.formatters) === null || _5 === void 0 ? void 0 : _5.events) === null || _6 === void 0 ? void 0 : _6.couponDenied;
|
|
217
244
|
const payload = {
|
|
218
245
|
cart_id: props === null || props === void 0 ? void 0 : props.cartId,
|
|
219
246
|
coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
|
|
@@ -228,8 +255,8 @@ export class ChordAnalytics {
|
|
|
228
255
|
return this.track('Coupon Denied', payload, options);
|
|
229
256
|
});
|
|
230
257
|
this.trackCouponEntered = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
231
|
-
var
|
|
232
|
-
const formatter = (
|
|
258
|
+
var _7, _8, _9;
|
|
259
|
+
const formatter = (_9 = (_8 = (_7 = this.options) === null || _7 === void 0 ? void 0 : _7.formatters) === null || _8 === void 0 ? void 0 : _8.events) === null || _9 === void 0 ? void 0 : _9.couponEntered;
|
|
233
260
|
const payload = {
|
|
234
261
|
cart_id: props === null || props === void 0 ? void 0 : props.cartId,
|
|
235
262
|
coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
|
|
@@ -243,8 +270,8 @@ export class ChordAnalytics {
|
|
|
243
270
|
return this.track('Coupon Entered', payload, options);
|
|
244
271
|
});
|
|
245
272
|
this.trackCouponRemoved = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
246
|
-
var
|
|
247
|
-
const formatter = (
|
|
273
|
+
var _10, _11, _12;
|
|
274
|
+
const formatter = (_12 = (_11 = (_10 = this.options) === null || _10 === void 0 ? void 0 : _10.formatters) === null || _11 === void 0 ? void 0 : _11.events) === null || _12 === void 0 ? void 0 : _12.couponRemoved;
|
|
248
275
|
const payload = {
|
|
249
276
|
cart_id: props === null || props === void 0 ? void 0 : props.cartId,
|
|
250
277
|
coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
|
|
@@ -259,8 +286,8 @@ export class ChordAnalytics {
|
|
|
259
286
|
return this.track('Coupon Removed', payload, options);
|
|
260
287
|
});
|
|
261
288
|
this.trackEmailCaptured = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
var
|
|
263
|
-
const formatter = (
|
|
289
|
+
var _13, _14, _15;
|
|
290
|
+
const formatter = (_15 = (_14 = (_13 = this.options) === null || _13 === void 0 ? void 0 : _13.formatters) === null || _14 === void 0 ? void 0 : _14.events) === null || _15 === void 0 ? void 0 : _15.emailCaptured;
|
|
264
291
|
const payload = {
|
|
265
292
|
email: props === null || props === void 0 ? void 0 : props.email,
|
|
266
293
|
placement_component: props === null || props === void 0 ? void 0 : props.placementComponent,
|
|
@@ -273,13 +300,13 @@ export class ChordAnalytics {
|
|
|
273
300
|
return this.track('Email Captured', payload, options);
|
|
274
301
|
});
|
|
275
302
|
this.trackProductAdded = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
276
|
-
var
|
|
277
|
-
const formatter = (
|
|
278
|
-
const product = (
|
|
279
|
-
const cart = (
|
|
303
|
+
var _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27;
|
|
304
|
+
const formatter = (_18 = (_17 = (_16 = this.options) === null || _16 === void 0 ? void 0 : _16.formatters) === null || _17 === void 0 ? void 0 : _17.events) === null || _18 === void 0 ? void 0 : _18.productAdded;
|
|
305
|
+
const product = (_22 = (_21 = (_20 = (_19 = this.options) === null || _19 === void 0 ? void 0 : _19.formatters) === null || _20 === void 0 ? void 0 : _20.objects) === null || _21 === void 0 ? void 0 : _21.product) === null || _22 === void 0 ? void 0 : _22.call(_21, props === null || props === void 0 ? void 0 : props.product);
|
|
306
|
+
const cart = (_26 = (_25 = (_24 = (_23 = this.options) === null || _23 === void 0 ? void 0 : _23.formatters) === null || _24 === void 0 ? void 0 : _24.objects) === null || _25 === void 0 ? void 0 : _25.cart) === null || _26 === void 0 ? void 0 : _26.call(_25, {
|
|
280
307
|
cart: props === null || props === void 0 ? void 0 : props.cart,
|
|
281
308
|
});
|
|
282
|
-
const quantity = ((
|
|
309
|
+
const quantity = ((_27 = props === null || props === void 0 ? void 0 : props.product) === null || _27 === void 0 ? void 0 : _27.quantity) || 1;
|
|
283
310
|
const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], total: product.price * (quantity || 1), value: product.price * (quantity || 1) });
|
|
284
311
|
if (typeof formatter === 'function') {
|
|
285
312
|
const formattedPayload = formatter(props, payload);
|
|
@@ -288,14 +315,14 @@ export class ChordAnalytics {
|
|
|
288
315
|
return this.track('Product Added', payload, options);
|
|
289
316
|
});
|
|
290
317
|
this.trackProductClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
291
|
-
var
|
|
292
|
-
const formatter = (
|
|
293
|
-
const product = (
|
|
294
|
-
const cart = (
|
|
318
|
+
var _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40;
|
|
319
|
+
const formatter = (_30 = (_29 = (_28 = this.options) === null || _28 === void 0 ? void 0 : _28.formatters) === null || _29 === void 0 ? void 0 : _29.events) === null || _30 === void 0 ? void 0 : _30.productClicked;
|
|
320
|
+
const product = (_34 = (_33 = (_32 = (_31 = this.options) === null || _31 === void 0 ? void 0 : _31.formatters) === null || _32 === void 0 ? void 0 : _32.objects) === null || _33 === void 0 ? void 0 : _33.product) === null || _34 === void 0 ? void 0 : _34.call(_33, props === null || props === void 0 ? void 0 : props.product);
|
|
321
|
+
const cart = (_38 = (_37 = (_36 = (_35 = this.options) === null || _35 === void 0 ? void 0 : _35.formatters) === null || _36 === void 0 ? void 0 : _36.objects) === null || _37 === void 0 ? void 0 : _37.cart) === null || _38 === void 0 ? void 0 : _38.call(_37, {
|
|
295
322
|
cart: props === null || props === void 0 ? void 0 : props.cart,
|
|
296
323
|
});
|
|
297
|
-
const quantity = ((
|
|
298
|
-
const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, item_list_id: (
|
|
324
|
+
const quantity = ((_39 = props === null || props === void 0 ? void 0 : props.product) === null || _39 === void 0 ? void 0 : _39.quantity) || 1;
|
|
325
|
+
const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, item_list_id: (_40 = props === null || props === void 0 ? void 0 : props.listId) === null || _40 === void 0 ? void 0 : _40.toString(), item_list_name: props === null || props === void 0 ? void 0 : props.listName, products: [Object.assign(Object.assign({}, product), { quantity })] });
|
|
299
326
|
if (typeof formatter === 'function') {
|
|
300
327
|
const formattedPayload = formatter(props, payload);
|
|
301
328
|
return this.track('Product Clicked', formattedPayload, options);
|
|
@@ -303,13 +330,13 @@ export class ChordAnalytics {
|
|
|
303
330
|
return this.track('Product Clicked', payload, options);
|
|
304
331
|
});
|
|
305
332
|
this.trackVariantClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
306
|
-
var
|
|
307
|
-
const formatter = (
|
|
308
|
-
const product = (
|
|
309
|
-
const cart = (
|
|
333
|
+
var _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52;
|
|
334
|
+
const formatter = (_43 = (_42 = (_41 = this.options) === null || _41 === void 0 ? void 0 : _41.formatters) === null || _42 === void 0 ? void 0 : _42.events) === null || _43 === void 0 ? void 0 : _43.variantClicked;
|
|
335
|
+
const product = (_47 = (_46 = (_45 = (_44 = this.options) === null || _44 === void 0 ? void 0 : _44.formatters) === null || _45 === void 0 ? void 0 : _45.objects) === null || _46 === void 0 ? void 0 : _46.product) === null || _47 === void 0 ? void 0 : _47.call(_46, props === null || props === void 0 ? void 0 : props.product);
|
|
336
|
+
const cart = (_51 = (_50 = (_49 = (_48 = this.options) === null || _48 === void 0 ? void 0 : _48.formatters) === null || _49 === void 0 ? void 0 : _49.objects) === null || _50 === void 0 ? void 0 : _50.cart) === null || _51 === void 0 ? void 0 : _51.call(_50, {
|
|
310
337
|
cart: props === null || props === void 0 ? void 0 : props.cart,
|
|
311
338
|
});
|
|
312
|
-
const quantity = ((
|
|
339
|
+
const quantity = ((_52 = props === null || props === void 0 ? void 0 : props.product) === null || _52 === void 0 ? void 0 : _52.quantity) || 1;
|
|
313
340
|
const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, quantity: quantity, line_item_id: props === null || props === void 0 ? void 0 : props.lineItemId, coupon: props === null || props === void 0 ? void 0 : props.coupon });
|
|
314
341
|
if (typeof formatter === 'function') {
|
|
315
342
|
const formattedPayload = formatter(props, payload);
|
|
@@ -318,13 +345,13 @@ export class ChordAnalytics {
|
|
|
318
345
|
return this.track('Variant Clicked', payload, options);
|
|
319
346
|
});
|
|
320
347
|
this.trackProductListFiltered = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
321
|
-
var
|
|
322
|
-
const formatter = (
|
|
348
|
+
var _53, _54, _55, _56, _57;
|
|
349
|
+
const formatter = (_55 = (_54 = (_53 = this.options) === null || _53 === void 0 ? void 0 : _53.formatters) === null || _54 === void 0 ? void 0 : _54.events) === null || _55 === void 0 ? void 0 : _55.productListFiltered;
|
|
323
350
|
const payload = {
|
|
324
351
|
category: props === null || props === void 0 ? void 0 : props.category,
|
|
325
352
|
filters: props === null || props === void 0 ? void 0 : props.filters,
|
|
326
|
-
list_id: (
|
|
327
|
-
item_list_id: (
|
|
353
|
+
list_id: (_56 = props === null || props === void 0 ? void 0 : props.listId) === null || _56 === void 0 ? void 0 : _56.toString(),
|
|
354
|
+
item_list_id: (_57 = props === null || props === void 0 ? void 0 : props.listId) === null || _57 === void 0 ? void 0 : _57.toString(),
|
|
328
355
|
item_list_name: props === null || props === void 0 ? void 0 : props.listName,
|
|
329
356
|
sorts: props === null || props === void 0 ? void 0 : props.sorts,
|
|
330
357
|
};
|
|
@@ -335,14 +362,14 @@ export class ChordAnalytics {
|
|
|
335
362
|
return this.track('Product List Filtered', payload, options);
|
|
336
363
|
});
|
|
337
364
|
this.trackProductListViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
338
|
-
var
|
|
339
|
-
const formatter = (
|
|
365
|
+
var _58, _59, _60, _61, _62, _63;
|
|
366
|
+
const formatter = (_60 = (_59 = (_58 = this.options) === null || _58 === void 0 ? void 0 : _58.formatters) === null || _59 === void 0 ? void 0 : _59.events) === null || _60 === void 0 ? void 0 : _60.productListViewed;
|
|
340
367
|
const payload = {
|
|
341
368
|
category: props === null || props === void 0 ? void 0 : props.category,
|
|
342
|
-
list_id: (
|
|
343
|
-
item_list_id: (
|
|
369
|
+
list_id: (_61 = props === null || props === void 0 ? void 0 : props.listId) === null || _61 === void 0 ? void 0 : _61.toString(),
|
|
370
|
+
item_list_id: (_62 = props === null || props === void 0 ? void 0 : props.listId) === null || _62 === void 0 ? void 0 : _62.toString(),
|
|
344
371
|
item_list_name: props === null || props === void 0 ? void 0 : props.listName,
|
|
345
|
-
products: (
|
|
372
|
+
products: (_63 = props === null || props === void 0 ? void 0 : props.products) === null || _63 === void 0 ? void 0 : _63.map((p, i) => {
|
|
346
373
|
var _a, _b, _c, _d;
|
|
347
374
|
return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
|
|
348
375
|
}),
|
|
@@ -355,8 +382,8 @@ export class ChordAnalytics {
|
|
|
355
382
|
return this.track('Product List Viewed', payload, options);
|
|
356
383
|
});
|
|
357
384
|
this.trackProductRemoved = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
358
|
-
var
|
|
359
|
-
const formatter = (
|
|
385
|
+
var _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78;
|
|
386
|
+
const formatter = (_66 = (_65 = (_64 = this.options) === null || _64 === void 0 ? void 0 : _64.formatters) === null || _65 === void 0 ? void 0 : _65.events) === null || _66 === void 0 ? void 0 : _66.productRemoved;
|
|
360
387
|
/*
|
|
361
388
|
const product = this.options?.formatters?.objects?.product?.({
|
|
362
389
|
position: props?.position,
|
|
@@ -365,13 +392,13 @@ export class ChordAnalytics {
|
|
|
365
392
|
variantId: props?.variantId,
|
|
366
393
|
})
|
|
367
394
|
*/
|
|
368
|
-
const lineItem = (
|
|
395
|
+
const lineItem = (_70 = (_69 = (_68 = (_67 = this.options) === null || _67 === void 0 ? void 0 : _67.formatters) === null || _68 === void 0 ? void 0 : _68.objects) === null || _69 === void 0 ? void 0 : _69.lineItem) === null || _70 === void 0 ? void 0 : _70.call(_69, {
|
|
369
396
|
lineItem: props === null || props === void 0 ? void 0 : props.lineItem,
|
|
370
397
|
});
|
|
371
|
-
const cart = (
|
|
398
|
+
const cart = (_74 = (_73 = (_72 = (_71 = this.options) === null || _71 === void 0 ? void 0 : _71.formatters) === null || _72 === void 0 ? void 0 : _72.objects) === null || _73 === void 0 ? void 0 : _73.cart) === null || _74 === void 0 ? void 0 : _74.call(_73, {
|
|
372
399
|
cart: props === null || props === void 0 ? void 0 : props.cart,
|
|
373
400
|
});
|
|
374
|
-
const payload = Object.assign(Object.assign({}, lineItem), { cart_id: cart.cart_id, currency: cart.currency, products: [lineItem], total: ((
|
|
401
|
+
const payload = Object.assign(Object.assign({}, lineItem), { cart_id: cart.cart_id, currency: cart.currency, products: [lineItem], total: ((_75 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _75 !== void 0 ? _75 : 0) * ((_76 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _76 !== void 0 ? _76 : 1), value: ((_77 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _77 !== void 0 ? _77 : 0) * ((_78 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _78 !== void 0 ? _78 : 1) });
|
|
375
402
|
if (typeof formatter === 'function') {
|
|
376
403
|
const formattedPayload = formatter(props, payload);
|
|
377
404
|
return this.track('Product Removed', formattedPayload, options);
|
|
@@ -379,14 +406,14 @@ export class ChordAnalytics {
|
|
|
379
406
|
return this.track('Product Removed', payload, options);
|
|
380
407
|
});
|
|
381
408
|
this.trackProductViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
382
|
-
var
|
|
383
|
-
const formatter = (
|
|
384
|
-
const product = (
|
|
385
|
-
const cart = (
|
|
409
|
+
var _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91;
|
|
410
|
+
const formatter = (_81 = (_80 = (_79 = this.options) === null || _79 === void 0 ? void 0 : _79.formatters) === null || _80 === void 0 ? void 0 : _80.events) === null || _81 === void 0 ? void 0 : _81.productViewed;
|
|
411
|
+
const product = (_85 = (_84 = (_83 = (_82 = this.options) === null || _82 === void 0 ? void 0 : _82.formatters) === null || _83 === void 0 ? void 0 : _83.objects) === null || _84 === void 0 ? void 0 : _84.product) === null || _85 === void 0 ? void 0 : _85.call(_84, props === null || props === void 0 ? void 0 : props.product);
|
|
412
|
+
const cart = (_89 = (_88 = (_87 = (_86 = this.options) === null || _86 === void 0 ? void 0 : _86.formatters) === null || _87 === void 0 ? void 0 : _87.objects) === null || _88 === void 0 ? void 0 : _88.cart) === null || _89 === void 0 ? void 0 : _89.call(_88, {
|
|
386
413
|
cart: props === null || props === void 0 ? void 0 : props.cart,
|
|
387
414
|
});
|
|
388
|
-
const quantity = ((
|
|
389
|
-
const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], value: product.price * (((
|
|
415
|
+
const quantity = ((_90 = props === null || props === void 0 ? void 0 : props.product) === null || _90 === void 0 ? void 0 : _90.quantity) || 1;
|
|
416
|
+
const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], value: product.price * (((_91 = props === null || props === void 0 ? void 0 : props.product) === null || _91 === void 0 ? void 0 : _91.quantity) || 1) });
|
|
390
417
|
if (typeof formatter === 'function') {
|
|
391
418
|
const formattedPayload = formatter(props, payload);
|
|
392
419
|
return this.track('Product Viewed', formattedPayload, options);
|
|
@@ -394,12 +421,12 @@ export class ChordAnalytics {
|
|
|
394
421
|
return this.track('Product Viewed', payload, options);
|
|
395
422
|
});
|
|
396
423
|
this.trackProductsSearched = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
397
|
-
var
|
|
398
|
-
const formatter = (
|
|
424
|
+
var _92, _93, _94, _95;
|
|
425
|
+
const formatter = (_94 = (_93 = (_92 = this.options) === null || _92 === void 0 ? void 0 : _92.formatters) === null || _93 === void 0 ? void 0 : _93.events) === null || _94 === void 0 ? void 0 : _94.productsSearched;
|
|
399
426
|
const payload = {
|
|
400
427
|
currency: props === null || props === void 0 ? void 0 : props.currency,
|
|
401
428
|
price: typeof (props === null || props === void 0 ? void 0 : props.price) !== 'undefined' ? Number(props === null || props === void 0 ? void 0 : props.price) : undefined,
|
|
402
|
-
product_id: (
|
|
429
|
+
product_id: (_95 = props === null || props === void 0 ? void 0 : props.productId) === null || _95 === void 0 ? void 0 : _95.toString(),
|
|
403
430
|
quantity: props === null || props === void 0 ? void 0 : props.quantity,
|
|
404
431
|
query: props === null || props === void 0 ? void 0 : props.query,
|
|
405
432
|
};
|
|
@@ -410,8 +437,8 @@ export class ChordAnalytics {
|
|
|
410
437
|
return this.track('Products Searched', payload, options);
|
|
411
438
|
});
|
|
412
439
|
this.trackSignedIn = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
413
|
-
var
|
|
414
|
-
const formatter = (
|
|
440
|
+
var _96, _97, _98;
|
|
441
|
+
const formatter = (_98 = (_97 = (_96 = this.options) === null || _96 === void 0 ? void 0 : _96.formatters) === null || _97 === void 0 ? void 0 : _97.events) === null || _98 === void 0 ? void 0 : _98.signedIn;
|
|
415
442
|
const payload = {
|
|
416
443
|
email: props === null || props === void 0 ? void 0 : props.email,
|
|
417
444
|
method: props === null || props === void 0 ? void 0 : props.method,
|
|
@@ -423,8 +450,8 @@ export class ChordAnalytics {
|
|
|
423
450
|
return this.track('Signed In', payload, options);
|
|
424
451
|
});
|
|
425
452
|
this.trackSignedOut = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
426
|
-
var
|
|
427
|
-
const formatter = (
|
|
453
|
+
var _99, _100, _101;
|
|
454
|
+
const formatter = (_101 = (_100 = (_99 = this.options) === null || _99 === void 0 ? void 0 : _99.formatters) === null || _100 === void 0 ? void 0 : _100.events) === null || _101 === void 0 ? void 0 : _101.signedOut;
|
|
428
455
|
const payload = {
|
|
429
456
|
email: props === null || props === void 0 ? void 0 : props.email,
|
|
430
457
|
};
|
|
@@ -435,8 +462,8 @@ export class ChordAnalytics {
|
|
|
435
462
|
return this.track('Signed Out', payload, options);
|
|
436
463
|
});
|
|
437
464
|
this.trackSignedUp = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
438
|
-
var
|
|
439
|
-
const formatter = (
|
|
465
|
+
var _102, _103, _104;
|
|
466
|
+
const formatter = (_104 = (_103 = (_102 = this.options) === null || _102 === void 0 ? void 0 : _102.formatters) === null || _103 === void 0 ? void 0 : _103.events) === null || _104 === void 0 ? void 0 : _104.signedUp;
|
|
440
467
|
const payload = {
|
|
441
468
|
email: props === null || props === void 0 ? void 0 : props.email,
|
|
442
469
|
method: props === null || props === void 0 ? void 0 : props.method,
|
|
@@ -448,8 +475,8 @@ export class ChordAnalytics {
|
|
|
448
475
|
return this.track('Signed Up', payload, options);
|
|
449
476
|
});
|
|
450
477
|
this.trackLoginStarted = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
451
|
-
var
|
|
452
|
-
const formatter = (
|
|
478
|
+
var _105, _106, _107;
|
|
479
|
+
const formatter = (_107 = (_106 = (_105 = this.options) === null || _105 === void 0 ? void 0 : _105.formatters) === null || _106 === void 0 ? void 0 : _106.events) === null || _107 === void 0 ? void 0 : _107.loginStarted;
|
|
453
480
|
const payload = {
|
|
454
481
|
email: props === null || props === void 0 ? void 0 : props.email,
|
|
455
482
|
};
|
|
@@ -460,8 +487,8 @@ export class ChordAnalytics {
|
|
|
460
487
|
return this.track('Login Started', payload, options);
|
|
461
488
|
});
|
|
462
489
|
this.trackSubscriptionCancelled = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
463
|
-
var
|
|
464
|
-
const formatter = (
|
|
490
|
+
var _108, _109, _110, _111;
|
|
491
|
+
const formatter = (_110 = (_109 = (_108 = this.options) === null || _108 === void 0 ? void 0 : _108.formatters) === null || _109 === void 0 ? void 0 : _109.events) === null || _110 === void 0 ? void 0 : _110.subscriptionCancelled;
|
|
465
492
|
const payload = {
|
|
466
493
|
actionable_date: props === null || props === void 0 ? void 0 : props.actionableDate,
|
|
467
494
|
address: props === null || props === void 0 ? void 0 : props.address,
|
|
@@ -470,7 +497,7 @@ export class ChordAnalytics {
|
|
|
470
497
|
end_date: props === null || props === void 0 ? void 0 : props.endDate,
|
|
471
498
|
interval_length: props === null || props === void 0 ? void 0 : props.intervalLength,
|
|
472
499
|
interval_units: props === null || props === void 0 ? void 0 : props.intervalUnits,
|
|
473
|
-
products: (
|
|
500
|
+
products: (_111 = props === null || props === void 0 ? void 0 : props.products) === null || _111 === void 0 ? void 0 : _111.map((p, i) => {
|
|
474
501
|
var _a, _b, _c, _d;
|
|
475
502
|
return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
|
|
476
503
|
}),
|
|
@@ -485,8 +512,8 @@ export class ChordAnalytics {
|
|
|
485
512
|
return this.track('Subscription Cancelled', payload, options);
|
|
486
513
|
});
|
|
487
514
|
this.trackNavigationClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
488
|
-
var
|
|
489
|
-
const formatter = (
|
|
515
|
+
var _112, _113, _114;
|
|
516
|
+
const formatter = (_114 = (_113 = (_112 = this.options) === null || _112 === void 0 ? void 0 : _112.formatters) === null || _113 === void 0 ? void 0 : _113.events) === null || _114 === void 0 ? void 0 : _114.navigationClicked;
|
|
490
517
|
const payload = {
|
|
491
518
|
category: props === null || props === void 0 ? void 0 : props.category,
|
|
492
519
|
label: props === null || props === void 0 ? void 0 : props.label,
|
|
@@ -501,15 +528,15 @@ export class ChordAnalytics {
|
|
|
501
528
|
return this.track('Navigation Clicked', payload, options);
|
|
502
529
|
});
|
|
503
530
|
this.trackPaymentInfoEntered = (props, options) => __awaiter(this, void 0, void 0, function* () {
|
|
504
|
-
var
|
|
505
|
-
const formatter = (
|
|
531
|
+
var _115, _116, _117, _118;
|
|
532
|
+
const formatter = (_117 = (_116 = (_115 = this.options) === null || _115 === void 0 ? void 0 : _115.formatters) === null || _116 === void 0 ? void 0 : _116.events) === null || _117 === void 0 ? void 0 : _117.paymentInfoEntered;
|
|
506
533
|
const payload = {
|
|
507
534
|
checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
|
|
508
535
|
coupon: props === null || props === void 0 ? void 0 : props.coupon,
|
|
509
536
|
currency: props === null || props === void 0 ? void 0 : props.currency,
|
|
510
537
|
order_id: props === null || props === void 0 ? void 0 : props.orderId,
|
|
511
538
|
payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
|
|
512
|
-
products: (
|
|
539
|
+
products: (_118 = props === null || props === void 0 ? void 0 : props.products) === null || _118 === void 0 ? void 0 : _118.map((p, i) => {
|
|
513
540
|
var _a, _b, _c, _d;
|
|
514
541
|
return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
|
|
515
542
|
}),
|
|
@@ -526,8 +553,13 @@ export class ChordAnalytics {
|
|
|
526
553
|
const defaults = {
|
|
527
554
|
debug: false,
|
|
528
555
|
enableLogging: true,
|
|
556
|
+
namespace: 'chord',
|
|
529
557
|
stripNull: true,
|
|
530
558
|
};
|
|
531
559
|
this.options = Object.assign(Object.assign({}, defaults), options);
|
|
560
|
+
if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.cdpDomain) && ((_b = this.options) === null || _b === void 0 ? void 0 : _b.cdpWriteKey) && window) {
|
|
561
|
+
window[this.options.namespace] = (window === null || window === void 0 ? void 0 : window[this.options.namespace]) || this;
|
|
562
|
+
addCdpSnippet(this.options);
|
|
563
|
+
}
|
|
532
564
|
}
|
|
533
565
|
}
|
package/dist/types/client.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ObjectTypes {
|
|
|
11
11
|
LineItem: any;
|
|
12
12
|
Product: any;
|
|
13
13
|
}
|
|
14
|
-
export type AnyAnalytics = AnalyticsSnippet | Analytics | AnalyticsBrowser;
|
|
14
|
+
export type AnyAnalytics = AnalyticsSnippet | Analytics | AnalyticsBrowser | ChordAnalyticsQueue;
|
|
15
15
|
export type AnyOptions = Options;
|
|
16
16
|
export type AnyProduct = {
|
|
17
17
|
[key: string]: unknown;
|
|
@@ -28,9 +28,12 @@ export type AnyLineItem = {
|
|
|
28
28
|
};
|
|
29
29
|
export interface ChordAnalyticsOptions<T extends ObjectTypes = ObjectTypes> {
|
|
30
30
|
cdp?: AnyAnalytics | (() => AnyAnalytics);
|
|
31
|
+
cdpDomain?: string;
|
|
32
|
+
cdpWriteKey?: string;
|
|
31
33
|
debug?: boolean;
|
|
32
34
|
enableLogging?: boolean;
|
|
33
35
|
formatters: ChordAnalyticsFormatters<T>;
|
|
36
|
+
namespace?: string;
|
|
34
37
|
stripNull?: boolean;
|
|
35
38
|
metadata: EventMetadata;
|
|
36
39
|
}
|
|
@@ -62,3 +65,9 @@ export interface versionMetadata {
|
|
|
62
65
|
export interface storeMetadata {
|
|
63
66
|
domain: string;
|
|
64
67
|
}
|
|
68
|
+
export type ChordAnalyticsQueue = {
|
|
69
|
+
track: (...args: any[]) => void;
|
|
70
|
+
identify: (...args: any[]) => void;
|
|
71
|
+
page: (...args: any[]) => void;
|
|
72
|
+
reset: (...args: any[]) => void;
|
|
73
|
+
};
|
package/package.json
CHANGED