@graphcommerce/googleanalytics 8.1.0-canary.9 → 9.0.0-canary.55

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,102 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.55
4
+
5
+ ## 9.0.0-canary.54
6
+
7
+ ## 8.1.0-canary.53
8
+
9
+ ## 8.1.0-canary.52
10
+
11
+ ## 8.1.0-canary.51
12
+
13
+ ## 8.1.0-canary.50
14
+
15
+ ## 8.1.0-canary.49
16
+
17
+ ### Patch Changes
18
+
19
+ - [#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
20
+ ([@paales](https://github.com/paales))
21
+
22
+ ## 8.1.0-canary.48
23
+
24
+ ## 8.1.0-canary.47
25
+
26
+ ## 8.1.0-canary.46
27
+
28
+ ## 8.1.0-canary.45
29
+
30
+ ## 8.1.0-canary.44
31
+
32
+ ## 8.1.0-canary.43
33
+
34
+ ## 8.1.0-canary.42
35
+
36
+ ## 8.1.0-canary.41
37
+
38
+ ## 8.1.0-canary.40
39
+
40
+ ## 8.1.0-canary.39
41
+
42
+ ## 8.1.0-canary.38
43
+
44
+ ## 8.1.0-canary.37
45
+
46
+ ## 8.1.0-canary.36
47
+
48
+ ## 8.1.0-canary.35
49
+
50
+ ## 8.1.0-canary.34
51
+
52
+ ## 8.1.0-canary.33
53
+
54
+ ## 8.1.0-canary.32
55
+
56
+ ## 8.1.0-canary.31
57
+
58
+ ## 8.1.0-canary.30
59
+
60
+ ## 8.1.0-canary.29
61
+
62
+ ## 8.1.0-canary.28
63
+
64
+ ## 8.1.0-canary.27
65
+
66
+ ## 8.1.0-canary.26
67
+
68
+ ## 8.1.0-canary.25
69
+
70
+ ## 8.1.0-canary.24
71
+
72
+ ## 8.1.0-canary.23
73
+
74
+ ## 8.1.0-canary.22
75
+
76
+ ## 8.1.0-canary.21
77
+
78
+ ## 8.1.0-canary.20
79
+
80
+ ## 8.1.0-canary.19
81
+
82
+ ## 8.1.0-canary.18
83
+
84
+ ## 8.1.0-canary.17
85
+
86
+ ## 8.1.0-canary.16
87
+
88
+ ## 8.1.0-canary.15
89
+
90
+ ## 8.1.0-canary.14
91
+
92
+ ## 8.1.0-canary.13
93
+
94
+ ## 8.1.0-canary.12
95
+
96
+ ## 8.1.0-canary.11
97
+
98
+ ## 8.1.0-canary.10
99
+
3
100
  ## 8.1.0-canary.9
4
101
 
5
102
  ## 8.1.0-canary.8
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.9",
5
+ "version": "9.0.0-canary.55",
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.9"
15
+ "@graphcommerce/google-datalayer": "9.0.0-canary.55"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.9",
19
- "@graphcommerce/graphql-mesh": "^8.1.0-canary.9",
20
- "@graphcommerce/magento-cart": "^8.1.0-canary.9",
21
- "@graphcommerce/magento-cart-payment-method": "^8.1.0-canary.9",
22
- "@graphcommerce/magento-cart-shipping-method": "^8.1.0-canary.9",
23
- "@graphcommerce/magento-product": "^8.1.0-canary.9",
24
- "@graphcommerce/next-config": "^8.1.0-canary.9",
25
- "@graphcommerce/next-ui": "^8.1.0-canary.9",
26
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.9",
27
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.9",
18
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.55",
19
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.55",
20
+ "@graphcommerce/magento-cart": "^9.0.0-canary.55",
21
+ "@graphcommerce/magento-cart-payment-method": "^9.0.0-canary.55",
22
+ "@graphcommerce/magento-cart-shipping-method": "^9.0.0-canary.55",
23
+ "@graphcommerce/magento-product": "^9.0.0-canary.55",
24
+ "@graphcommerce/next-config": "^9.0.0-canary.55",
25
+ "@graphcommerce/next-ui": "^9.0.0-canary.55",
26
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.55",
27
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.55",
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,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'