@graphcommerce/googleanalytics 6.2.0-canary.8 → 6.2.0-canary.80
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 +148 -0
- package/package.json +11 -11
- package/plugins/GaCartStartCheckoutLinkOrButton.tsx +5 -1
- package/plugins/GaViewItem.tsx +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,153 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.80
|
|
4
|
+
|
|
5
|
+
## 6.2.0-canary.79
|
|
6
|
+
|
|
7
|
+
## 6.2.0-canary.78
|
|
8
|
+
|
|
9
|
+
## 6.2.0-canary.77
|
|
10
|
+
|
|
11
|
+
## 6.2.0-canary.76
|
|
12
|
+
|
|
13
|
+
## 6.2.0-canary.75
|
|
14
|
+
|
|
15
|
+
## 6.2.0-canary.74
|
|
16
|
+
|
|
17
|
+
## 6.2.0-canary.73
|
|
18
|
+
|
|
19
|
+
## 6.2.0-canary.72
|
|
20
|
+
|
|
21
|
+
## 6.2.0-canary.71
|
|
22
|
+
|
|
23
|
+
## 6.2.0-canary.70
|
|
24
|
+
|
|
25
|
+
## 6.2.0-canary.69
|
|
26
|
+
|
|
27
|
+
## 6.2.0-canary.68
|
|
28
|
+
|
|
29
|
+
## 6.2.0-canary.67
|
|
30
|
+
|
|
31
|
+
## 6.2.0-canary.66
|
|
32
|
+
|
|
33
|
+
## 6.2.0-canary.65
|
|
34
|
+
|
|
35
|
+
## 6.2.0-canary.64
|
|
36
|
+
|
|
37
|
+
## 6.2.0-canary.63
|
|
38
|
+
|
|
39
|
+
## 6.2.0-canary.62
|
|
40
|
+
|
|
41
|
+
## 6.2.0-canary.61
|
|
42
|
+
|
|
43
|
+
## 6.2.0-canary.60
|
|
44
|
+
|
|
45
|
+
## 6.2.0-canary.59
|
|
46
|
+
|
|
47
|
+
## 6.2.0-canary.58
|
|
48
|
+
|
|
49
|
+
## 6.2.0-canary.57
|
|
50
|
+
|
|
51
|
+
## 6.2.0-canary.56
|
|
52
|
+
|
|
53
|
+
## 6.2.0-canary.55
|
|
54
|
+
|
|
55
|
+
## 6.2.0-canary.54
|
|
56
|
+
|
|
57
|
+
## 6.2.0-canary.53
|
|
58
|
+
|
|
59
|
+
## 6.2.0-canary.52
|
|
60
|
+
|
|
61
|
+
## 6.2.0-canary.51
|
|
62
|
+
|
|
63
|
+
## 6.2.0-canary.50
|
|
64
|
+
|
|
65
|
+
## 6.2.0-canary.49
|
|
66
|
+
|
|
67
|
+
## 6.2.0-canary.48
|
|
68
|
+
|
|
69
|
+
## 6.2.0-canary.47
|
|
70
|
+
|
|
71
|
+
## 6.2.0-canary.46
|
|
72
|
+
|
|
73
|
+
## 6.2.0-canary.45
|
|
74
|
+
|
|
75
|
+
## 6.2.0-canary.44
|
|
76
|
+
|
|
77
|
+
## 6.2.0-canary.43
|
|
78
|
+
|
|
79
|
+
## 6.2.0-canary.42
|
|
80
|
+
|
|
81
|
+
## 6.2.0-canary.41
|
|
82
|
+
|
|
83
|
+
## 6.2.0-canary.40
|
|
84
|
+
|
|
85
|
+
## 6.2.0-canary.39
|
|
86
|
+
|
|
87
|
+
## 6.2.0-canary.38
|
|
88
|
+
|
|
89
|
+
## 6.2.0-canary.37
|
|
90
|
+
|
|
91
|
+
## 6.2.0-canary.36
|
|
92
|
+
|
|
93
|
+
## 6.2.0-canary.35
|
|
94
|
+
|
|
95
|
+
## 6.2.0-canary.34
|
|
96
|
+
|
|
97
|
+
## 6.2.0-canary.33
|
|
98
|
+
|
|
99
|
+
## 6.2.0-canary.32
|
|
100
|
+
|
|
101
|
+
## 6.2.0-canary.31
|
|
102
|
+
|
|
103
|
+
## 6.2.0-canary.30
|
|
104
|
+
|
|
105
|
+
## 6.2.0-canary.29
|
|
106
|
+
|
|
107
|
+
## 6.2.0-canary.28
|
|
108
|
+
|
|
109
|
+
## 6.2.0-canary.27
|
|
110
|
+
|
|
111
|
+
## 6.2.0-canary.26
|
|
112
|
+
|
|
113
|
+
## 6.2.0-canary.25
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- [#1944](https://github.com/graphcommerce-org/graphcommerce/pull/1944) [`d83c92b76`](https://github.com/graphcommerce-org/graphcommerce/commit/d83c92b767cfab24b33b7530837e601f1b49de38) - When there are no items in the cart, do not send a viewCart event ([@paales](https://github.com/paales))
|
|
118
|
+
|
|
119
|
+
## 6.2.0-canary.24
|
|
120
|
+
|
|
121
|
+
## 6.2.0-canary.23
|
|
122
|
+
|
|
123
|
+
## 6.2.0-canary.22
|
|
124
|
+
|
|
125
|
+
## 6.2.0-canary.21
|
|
126
|
+
|
|
127
|
+
## 6.2.0-canary.20
|
|
128
|
+
|
|
129
|
+
## 6.2.0-canary.19
|
|
130
|
+
|
|
131
|
+
## 6.2.0-canary.18
|
|
132
|
+
|
|
133
|
+
## 6.2.0-canary.17
|
|
134
|
+
|
|
135
|
+
## 6.2.0-canary.16
|
|
136
|
+
|
|
137
|
+
## 6.2.0-canary.15
|
|
138
|
+
|
|
139
|
+
## 6.2.0-canary.14
|
|
140
|
+
|
|
141
|
+
## 6.2.0-canary.13
|
|
142
|
+
|
|
143
|
+
## 6.2.0-canary.12
|
|
144
|
+
|
|
145
|
+
## 6.2.0-canary.11
|
|
146
|
+
|
|
147
|
+
## 6.2.0-canary.10
|
|
148
|
+
|
|
149
|
+
## 6.2.0-canary.9
|
|
150
|
+
|
|
3
151
|
## 6.2.0-canary.8
|
|
4
152
|
|
|
5
153
|
## 6.2.0-canary.7
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/googleanalytics",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.80",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@graphcommerce/graphql-mesh": "6.2.0-canary.
|
|
16
|
-
"@graphcommerce/magento-cart": "6.2.0-canary.
|
|
17
|
-
"@graphcommerce/magento-cart-payment-method": "6.2.0-canary.
|
|
18
|
-
"@graphcommerce/magento-cart-shipping-method": "6.2.0-canary.
|
|
19
|
-
"@graphcommerce/magento-product": "6.2.0-canary.
|
|
20
|
-
"@graphcommerce/next-config": "6.2.0-canary.
|
|
21
|
-
"@graphcommerce/next-ui": "6.2.0-canary.
|
|
15
|
+
"@graphcommerce/graphql-mesh": "6.2.0-canary.80",
|
|
16
|
+
"@graphcommerce/magento-cart": "6.2.0-canary.80",
|
|
17
|
+
"@graphcommerce/magento-cart-payment-method": "6.2.0-canary.80",
|
|
18
|
+
"@graphcommerce/magento-cart-shipping-method": "6.2.0-canary.80",
|
|
19
|
+
"@graphcommerce/magento-product": "6.2.0-canary.80",
|
|
20
|
+
"@graphcommerce/next-config": "6.2.0-canary.80",
|
|
21
|
+
"@graphcommerce/next-ui": "6.2.0-canary.80"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
25
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
26
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
24
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.80",
|
|
25
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.80",
|
|
26
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.80",
|
|
27
27
|
"@types/gtag.js": "^0.0.12"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -16,7 +16,11 @@ export function GaCartStartCheckoutLinkOrButton(
|
|
|
16
16
|
|
|
17
17
|
const cartObject = useMemoObject({ items: rest.items, prices: rest.prices })
|
|
18
18
|
|
|
19
|
-
useEffect(() =>
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (cartObject.items) {
|
|
21
|
+
gtagViewCart(cartObject)
|
|
22
|
+
}
|
|
23
|
+
}, [cartObject])
|
|
20
24
|
|
|
21
25
|
return (
|
|
22
26
|
<Prev
|
package/plugins/GaViewItem.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ProductPageMeta } from '@graphcommerce/magento-product'
|
|
2
2
|
import { IfConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
3
|
import { useMemoObject } from '@graphcommerce/next-ui'
|
|
4
4
|
import { useEffect } from 'react'
|
|
@@ -9,13 +9,14 @@ export const exported = '@graphcommerce/magento-product'
|
|
|
9
9
|
export const ifConfig: IfConfig = 'googleAnalyticsId'
|
|
10
10
|
|
|
11
11
|
/** When a product is added to the Cart, send a Google Analytics event */
|
|
12
|
-
function GaViewItem(props: PluginProps<
|
|
13
|
-
const { Prev,
|
|
12
|
+
function GaViewItem(props: PluginProps<React.ComponentProps<typeof ProductPageMeta>>) {
|
|
13
|
+
const { Prev, product } = props
|
|
14
|
+
const { price_range } = product
|
|
14
15
|
|
|
15
16
|
const viewItem = useMemoObject({
|
|
16
17
|
currency: price_range.minimum_price.final_price.currency,
|
|
17
18
|
value: price_range.minimum_price.final_price.value,
|
|
18
|
-
items: [productToGtagItem(
|
|
19
|
+
items: [productToGtagItem(product)],
|
|
19
20
|
})
|
|
20
21
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
21
22
|
useEffect(() => globalThis.gtag?.('event', 'view_item', viewItem), [viewItem])
|