@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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @akinon/pz-b2b
2
2
 
3
+ ## 1.24.0-rc.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 07927ac: ZERO-2457: Add more events for GTM tracking
8
+
9
+ ## 1.24.0-rc.3
10
+
3
11
  ## 1.24.0-rc.2
4
12
 
5
13
  ## 1.24.0-rc.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/pz-b2b",
3
- "version": "1.24.0-rc.2",
3
+ "version": "1.24.0-rc.4",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "peerDependencies": {
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
- item_name: product.name,
11
- item_id: product.pk,
12
- price: product.price
12
+ item_id: product?.pk?.toString(),
13
+ item_name: product?.name,
14
+ price: product?.price
13
15
  }))
14
16
  });
15
17
  };