@graphcommerce/googleanalytics 8.1.0-canary.8 → 9.0.0-canary.100

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 CHANGED
@@ -1,5 +1,197 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.100
4
+
5
+ ## 9.0.0-canary.99
6
+
7
+ ## 9.0.0-canary.98
8
+
9
+ ## 9.0.0-canary.97
10
+
11
+ ## 9.0.0-canary.96
12
+
13
+ ## 9.0.0-canary.95
14
+
15
+ ## 9.0.0-canary.94
16
+
17
+ ## 9.0.0-canary.93
18
+
19
+ ## 9.0.0-canary.92
20
+
21
+ ## 9.0.0-canary.91
22
+
23
+ ## 9.0.0-canary.90
24
+
25
+ ## 9.0.0-canary.89
26
+
27
+ ## 9.0.0-canary.88
28
+
29
+ ## 9.0.0-canary.87
30
+
31
+ ## 9.0.0-canary.86
32
+
33
+ ## 9.0.0-canary.85
34
+
35
+ ## 9.0.0-canary.84
36
+
37
+ ## 9.0.0-canary.83
38
+
39
+ ## 9.0.0-canary.82
40
+
41
+ ## 9.0.0-canary.81
42
+
43
+ ## 9.0.0-canary.80
44
+
45
+ ## 9.0.0-canary.79
46
+
47
+ ## 9.0.0-canary.78
48
+
49
+ ## 9.0.0-canary.77
50
+
51
+ ## 9.0.0-canary.76
52
+
53
+ ## 9.0.0-canary.75
54
+
55
+ ## 9.0.0-canary.74
56
+
57
+ ## 9.0.0-canary.73
58
+
59
+ ## 9.0.0-canary.72
60
+
61
+ ## 9.0.0-canary.71
62
+
63
+ ## 9.0.0-canary.70
64
+
65
+ ## 9.0.0-canary.69
66
+
67
+ ## 9.0.0-canary.68
68
+
69
+ ## 9.0.0-canary.67
70
+
71
+ ## 9.0.0-canary.66
72
+
73
+ ## 9.0.0-canary.65
74
+
75
+ ## 9.0.0-canary.64
76
+
77
+ ## 9.0.0-canary.63
78
+
79
+ ## 9.0.0-canary.62
80
+
81
+ ## 9.0.0-canary.61
82
+
83
+ ## 9.0.0-canary.60
84
+
85
+ ### Patch Changes
86
+
87
+ - [#2331](https://github.com/graphcommerce-org/graphcommerce/pull/2331) [`702bfc9`](https://github.com/graphcommerce-org/graphcommerce/commit/702bfc93566c9745546988e57988431d5d4d8cb0) - Moved plugins to new format ([@paales](https://github.com/paales))
88
+
89
+ ## 9.0.0-canary.59
90
+
91
+ ## 9.0.0-canary.58
92
+
93
+ ## 9.0.0-canary.57
94
+
95
+ ## 9.0.0-canary.56
96
+
97
+ ## 9.0.0-canary.55
98
+
99
+ ## 9.0.0-canary.54
100
+
101
+ ## 8.1.0-canary.53
102
+
103
+ ## 8.1.0-canary.52
104
+
105
+ ## 8.1.0-canary.51
106
+
107
+ ## 8.1.0-canary.50
108
+
109
+ ## 8.1.0-canary.49
110
+
111
+ ### Patch Changes
112
+
113
+ - [#2317](https://github.com/graphcommerce-org/graphcommerce/pull/2317) [`2f4a61d`](https://github.com/graphcommerce-org/graphcommerce/commit/2f4a61dfee853579c96fceb5351e459aa9524a60) - Moved import locations of Google Analytics and Google Tagmanager scripts to their recommended locations ([@paales](https://github.com/paales))
114
+
115
+ ## 8.1.0-canary.48
116
+
117
+ ## 8.1.0-canary.47
118
+
119
+ ## 8.1.0-canary.46
120
+
121
+ ## 8.1.0-canary.45
122
+
123
+ ## 8.1.0-canary.44
124
+
125
+ ## 8.1.0-canary.43
126
+
127
+ ## 8.1.0-canary.42
128
+
129
+ ## 8.1.0-canary.41
130
+
131
+ ## 8.1.0-canary.40
132
+
133
+ ## 8.1.0-canary.39
134
+
135
+ ## 8.1.0-canary.38
136
+
137
+ ## 8.1.0-canary.37
138
+
139
+ ## 8.1.0-canary.36
140
+
141
+ ## 8.1.0-canary.35
142
+
143
+ ## 8.1.0-canary.34
144
+
145
+ ## 8.1.0-canary.33
146
+
147
+ ## 8.1.0-canary.32
148
+
149
+ ## 8.1.0-canary.31
150
+
151
+ ## 8.1.0-canary.30
152
+
153
+ ## 8.1.0-canary.29
154
+
155
+ ## 8.1.0-canary.28
156
+
157
+ ## 8.1.0-canary.27
158
+
159
+ ## 8.1.0-canary.26
160
+
161
+ ## 8.1.0-canary.25
162
+
163
+ ## 8.1.0-canary.24
164
+
165
+ ## 8.1.0-canary.23
166
+
167
+ ## 8.1.0-canary.22
168
+
169
+ ## 8.1.0-canary.21
170
+
171
+ ## 8.1.0-canary.20
172
+
173
+ ## 8.1.0-canary.19
174
+
175
+ ## 8.1.0-canary.18
176
+
177
+ ## 8.1.0-canary.17
178
+
179
+ ## 8.1.0-canary.16
180
+
181
+ ## 8.1.0-canary.15
182
+
183
+ ## 8.1.0-canary.14
184
+
185
+ ## 8.1.0-canary.13
186
+
187
+ ## 8.1.0-canary.12
188
+
189
+ ## 8.1.0-canary.11
190
+
191
+ ## 8.1.0-canary.10
192
+
193
+ ## 8.1.0-canary.9
194
+
3
195
  ## 8.1.0-canary.8
4
196
 
5
197
  ## 8.1.0-canary.7
@@ -22,8 +214,7 @@
22
214
 
23
215
  ### Patch Changes
24
216
 
25
- - [#2233](https://github.com/graphcommerce-org/graphcommerce/pull/2233) [`cabeadc`](https://github.com/graphcommerce-org/graphcommerce/commit/cabeadce2b73ce072a2fa8b8ab1ab49907cda13b) - Added core web vitals measurements to the datalayer.
26
- ([@paales](https://github.com/paales))
217
+ - [#2233](https://github.com/graphcommerce-org/graphcommerce/pull/2233) [`cabeadc`](https://github.com/graphcommerce-org/graphcommerce/commit/cabeadce2b73ce072a2fa8b8ab1ab49907cda13b) - Added core web vitals measurements to the datalayer. ([@paales](https://github.com/paales))
27
218
 
28
219
  ## 8.0.5-canary.10
29
220
 
@@ -47,8 +238,7 @@
47
238
 
48
239
  ### Patch Changes
49
240
 
50
- - [#2233](https://github.com/graphcommerce-org/graphcommerce/pull/2233) [`cabeadc`](https://github.com/graphcommerce-org/graphcommerce/commit/cabeadce2b73ce072a2fa8b8ab1ab49907cda13b) - Added core web vitals measurements to the datalayer.
51
- ([@paales](https://github.com/paales))
241
+ - [#2233](https://github.com/graphcommerce-org/graphcommerce/pull/2233) [`cabeadc`](https://github.com/graphcommerce-org/graphcommerce/commit/cabeadce2b73ce072a2fa8b8ab1ab49907cda13b) - Added core web vitals measurements to the datalayer. ([@paales](https://github.com/paales))
52
242
 
53
243
  ## 8.0.5-canary.0
54
244
 
@@ -56,15 +246,13 @@
56
246
 
57
247
  ### Patch Changes
58
248
 
59
- - [#2158](https://github.com/graphcommerce-org/graphcommerce/pull/2158) [`34de808`](https://github.com/graphcommerce-org/graphcommerce/commit/34de8085e9352d1f3b20b26746685370ea10ab90) - Extracted the datalayer from the googleanalytics package and moved to google-datalayer package. Make sure Google Analytics and Google Tagmanager both can send events individually. Be able to configure the datalayer will send as GA4 or legacy GA3 events.
60
- ([@mikekeehnen](https://github.com/mikekeehnen))
249
+ - [#2158](https://github.com/graphcommerce-org/graphcommerce/pull/2158) [`34de808`](https://github.com/graphcommerce-org/graphcommerce/commit/34de8085e9352d1f3b20b26746685370ea10ab90) - Extracted the datalayer from the googleanalytics package and moved to google-datalayer package. Make sure Google Analytics and Google Tagmanager both can send events individually. Be able to configure the datalayer will send as GA4 or legacy GA3 events. ([@mikekeehnen](https://github.com/mikekeehnen))
61
250
 
62
251
  ## 8.0.4-canary.1
63
252
 
64
253
  ### Patch Changes
65
254
 
66
- - [#2158](https://github.com/graphcommerce-org/graphcommerce/pull/2158) [`34de808`](https://github.com/graphcommerce-org/graphcommerce/commit/34de8085e9352d1f3b20b26746685370ea10ab90) - Extracted the datalayer from the googleanalytics package and moved to google-datalayer package. Make sure Google Analytics and Google Tagmanager both can send events individually. Be able to configure the datalayer will send as GA4 or legacy GA3 events.
67
- ([@mikekeehnen](https://github.com/mikekeehnen))
255
+ - [#2158](https://github.com/graphcommerce-org/graphcommerce/pull/2158) [`34de808`](https://github.com/graphcommerce-org/graphcommerce/commit/34de8085e9352d1f3b20b26746685370ea10ab90) - Extracted the datalayer from the googleanalytics package and moved to google-datalayer package. Make sure Google Analytics and Google Tagmanager both can send events individually. Be able to configure the datalayer will send as GA4 or legacy GA3 events. ([@mikekeehnen](https://github.com/mikekeehnen))
68
256
 
69
257
  ## 8.0.4-canary.0
70
258
 
@@ -110,11 +298,9 @@
110
298
 
111
299
  ### Minor Changes
112
300
 
113
- - [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Support for all customizable product options (except file upload) on the product pages and in the cart.
114
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
301
+ - [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Support for all customizable product options (except file upload) on the product pages and in the cart. ([@Jessevdpoel](https://github.com/Jessevdpoel))
115
302
 
116
- - [#2127](https://github.com/graphcommerce-org/graphcommerce/pull/2127) [`124e6c9`](https://github.com/graphcommerce-org/graphcommerce/commit/124e6c92aa3b4b77f54235f0682c38438fd619b6) - Made all Magento dependencies optional in the `googleanalytics` and `googletagmanager` packages, allowing it to be installed in any project.
117
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
303
+ - [#2127](https://github.com/graphcommerce-org/graphcommerce/pull/2127) [`124e6c9`](https://github.com/graphcommerce-org/graphcommerce/commit/124e6c92aa3b4b77f54235f0682c38438fd619b6) - Made all Magento dependencies optional in the `googleanalytics` and `googletagmanager` packages, allowing it to be installed in any project. ([@Jessevdpoel](https://github.com/Jessevdpoel))
118
304
 
119
305
  ## 8.0.0-canary.100
120
306
 
@@ -178,8 +364,7 @@
178
364
 
179
365
  ### Minor Changes
180
366
 
181
- - [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Created UI for all customizable options except for the file upload customizable option
182
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
367
+ - [#2099](https://github.com/graphcommerce-org/graphcommerce/pull/2099) [`ff796b8`](https://github.com/graphcommerce-org/graphcommerce/commit/ff796b838fae6cb5e35b101500133b0235a8677d) - Created UI for all customizable options except for the file upload customizable option ([@Jessevdpoel](https://github.com/Jessevdpoel))
183
368
 
184
369
  ## 8.0.0-canary.70
185
370
 
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export {}
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": "8.1.0-canary.8",
5
+ "version": "9.0.0-canary.100",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,19 +12,19 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@graphcommerce/google-datalayer": "8.1.0-canary.8"
15
+ "@graphcommerce/google-datalayer": "9.0.0-canary.100"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.8",
19
- "@graphcommerce/graphql-mesh": "^8.1.0-canary.8",
20
- "@graphcommerce/magento-cart": "^8.1.0-canary.8",
21
- "@graphcommerce/magento-cart-payment-method": "^8.1.0-canary.8",
22
- "@graphcommerce/magento-cart-shipping-method": "^8.1.0-canary.8",
23
- "@graphcommerce/magento-product": "^8.1.0-canary.8",
24
- "@graphcommerce/next-config": "^8.1.0-canary.8",
25
- "@graphcommerce/next-ui": "^8.1.0-canary.8",
26
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.8",
27
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.8",
18
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.100",
19
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.100",
20
+ "@graphcommerce/magento-cart": "^9.0.0-canary.100",
21
+ "@graphcommerce/magento-cart-payment-method": "^9.0.0-canary.100",
22
+ "@graphcommerce/magento-cart-shipping-method": "^9.0.0-canary.100",
23
+ "@graphcommerce/magento-product": "^9.0.0-canary.100",
24
+ "@graphcommerce/next-config": "^9.0.0-canary.100",
25
+ "@graphcommerce/next-ui": "^9.0.0-canary.100",
26
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.100",
27
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.100",
28
28
  "@mui/material": "^5.10.16",
29
29
  "next": "*",
30
30
  "react": "^18.2.0",
@@ -1,23 +1,36 @@
1
- import type { PagesProps } from '@graphcommerce/framer-next-pages'
2
- import type { IfConfig, PluginConfig, PluginProps } from '@graphcommerce/next-config'
3
- import { GoogleAnalyticsScript } from '../components/GoogleAnalyticsScript'
4
-
5
- export const component = 'FramerNextPages'
6
- export const exported = '@graphcommerce/framer-next-pages'
7
- export const ifConfig: IfConfig = 'googleAnalyticsId'
1
+ /* eslint-disable @next/next/no-document-import-in-page */
2
+ /* eslint-disable @next/next/next-script-for-ga */
3
+ /* eslint-disable react/no-danger */
4
+ import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
5
+ import { storefrontConfig } from '@graphcommerce/next-ui/server'
6
+ import type { DocumentProps } from 'next/document'
8
7
 
9
8
  export const config: PluginConfig = {
10
9
  type: 'component',
11
- module: '@graphcommerce/framer-next-pages',
10
+ module: '@graphcommerce/next-ui/server',
12
11
  ifConfig: 'googleAnalyticsId',
13
12
  }
14
13
 
15
- export function FramerNextPages(props: PluginProps<PagesProps>) {
14
+ export function DocumentHeadEnd(props: PluginProps<DocumentProps>) {
16
15
  const { Prev, ...rest } = props
17
16
 
17
+ const id =
18
+ storefrontConfig(rest.locale)?.googleAnalyticsId ?? import.meta.graphCommerce.googleAnalyticsId
19
+
18
20
  return (
19
21
  <>
20
- <GoogleAnalyticsScript />
22
+ <script async src='https://www.googletagmanager.com/gtag/js?id=G-E0275MGY12' />
23
+ <script
24
+ dangerouslySetInnerHTML={{
25
+ __html: `
26
+ window.dataLayer = window.dataLayer || [];
27
+ function gtag(){dataLayer.push(arguments);}
28
+ gtag('js', new Date());
29
+
30
+ gtag('config', '${id}');
31
+ `,
32
+ }}
33
+ />
21
34
  <Prev {...rest} />
22
35
  </>
23
36
  )
@@ -1,13 +1,13 @@
1
- import { sendEvent } from '@graphcommerce/google-datalayer/api/sendEvent'
2
- import type { IfConfig, MethodPlugin } from '@graphcommerce/next-config'
1
+ import { sendEvent as sendEventType } from '@graphcommerce/google-datalayer/api/sendEvent'
2
+ import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
3
3
 
4
- export const func = 'sendEvent'
5
- export const exported = '@graphcommerce/google-datalayer/api/sendEvent'
6
- export const ifConfig: IfConfig = 'googleAnalyticsId'
4
+ export const config: PluginConfig = {
5
+ type: 'function',
6
+ module: '@graphcommerce/google-datalayer',
7
+ ifConfig: 'googleAnalyticsId',
8
+ }
7
9
 
8
- const gtagEvent: MethodPlugin<typeof sendEvent> = (prev, eventName, eventData) => {
10
+ export const sendEvent: FunctionPlugin<typeof sendEventType> = (prev, eventName, eventData) => {
9
11
  prev(eventName, eventData)
10
12
  globalThis.gtag('event', eventName, eventData)
11
13
  }
12
-
13
- export const plugin = gtagEvent
@@ -1,21 +0,0 @@
1
- import { useStorefrontConfig } from '@graphcommerce/next-ui'
2
- import Script from 'next/script'
3
-
4
- export function GoogleAnalyticsScript() {
5
- const id = useStorefrontConfig().googleAnalyticsId ?? import.meta.graphCommerce.googleAnalyticsId
6
-
7
- return (
8
- <>
9
- <Script
10
- strategy='afterInteractive'
11
- src={`https://www.googletagmanager.com/gtag/js?id=${id}`}
12
- />
13
- <Script id='gtag' strategy='afterInteractive'>{`
14
- window.dataLayer = window.dataLayer || [];
15
- function gtag(){dataLayer.push(arguments);}
16
- gtag('js', new Date());
17
- gtag('config', '${id}', { 'debug_mode':true });
18
- `}</Script>
19
- </>
20
- )
21
- }
@@ -1 +0,0 @@
1
- export * from './GoogleAnalyticsScript'