@chordcommerce/analytics 1.12.2 → 1.13.0
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/client/index.d.ts +1 -1
- package/dist/client/index.js +3 -3
- package/package.json +1 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export declare class ChordAnalytics<T extends ObjectTypes = ObjectTypes> {
|
|
|
67
67
|
* Send a `page` event to the CDP.
|
|
68
68
|
*/
|
|
69
69
|
page: {
|
|
70
|
-
(): void;
|
|
70
|
+
(props?: Record<string, any>): void;
|
|
71
71
|
};
|
|
72
72
|
reset: () => void;
|
|
73
73
|
trackCartViewed: (props: CartViewedInput<T>, options?: AnyOptions) => Promise<void>;
|
package/dist/client/index.js
CHANGED
|
@@ -167,19 +167,19 @@ export class ChordAnalytics {
|
|
|
167
167
|
/**
|
|
168
168
|
* Send a `page` event to the CDP.
|
|
169
169
|
*/
|
|
170
|
-
this.page = () => {
|
|
170
|
+
this.page = (props = {}) => {
|
|
171
171
|
try {
|
|
172
172
|
const pagePromises = [];
|
|
173
173
|
const a = this.ccdp();
|
|
174
174
|
if (a && typeof a.page === 'function') {
|
|
175
175
|
pagePromises.push(new Promise((resolve) => {
|
|
176
|
-
a.page({ meta: this.meta() }, () => resolve());
|
|
176
|
+
a.page(Object.assign(Object.assign({}, props), { meta: this.meta() }), () => resolve());
|
|
177
177
|
}));
|
|
178
178
|
}
|
|
179
179
|
const b = this.cdp();
|
|
180
180
|
if (b && typeof b.page === 'function') {
|
|
181
181
|
pagePromises.push(new Promise((resolve) => {
|
|
182
|
-
b.page({ meta: this.meta() }, () => resolve());
|
|
182
|
+
b.page(Object.assign(Object.assign({}, props), { meta: this.meta() }), () => resolve());
|
|
183
183
|
}));
|
|
184
184
|
}
|
|
185
185
|
// We don't return the promise to maintain the void return type
|
package/package.json
CHANGED