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