@akinon/pz-b2b 1.24.0-rc.2 → 1.24.0-rc.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/utils/gtm.ts +6 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/utils/gtm.ts
CHANGED
@@ -3,13 +3,15 @@
|
|
3
3
|
import { GA4EventParams, GTMEvent, Product } from '@akinon/next/types';
|
4
4
|
|
5
5
|
export const pushCartView = (
|
6
|
-
products: Pick<Product, 'name' | 'pk' | 'price'>[]
|
6
|
+
products: Pick<Product, 'name' | 'pk' | 'price' | 'currency_type'>[]
|
7
7
|
) => {
|
8
|
+
const productCurrency = products[0]?.currency_type;
|
8
9
|
pushEventGA4('view_cart', {
|
10
|
+
currency: productCurrency,
|
9
11
|
items: products?.map((product) => ({
|
10
|
-
|
11
|
-
|
12
|
-
price: product
|
12
|
+
item_id: product?.pk?.toString(),
|
13
|
+
item_name: product?.name,
|
14
|
+
price: product?.price
|
13
15
|
}))
|
14
16
|
});
|
15
17
|
};
|