@graphcommerce/googletagmanager 5.2.0-canary.8 → 6.0.0-canary.20
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 +24 -0
- package/Config.graphqls +15 -0
- package/README.md +3 -8
- package/components/GoogleTagManagerScript.tsx +2 -1
- package/hooks/useGoogleTagmanagerId.ts +5 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.0.0-canary.20
|
|
4
|
+
|
|
5
|
+
## 5.2.0-canary.19
|
|
6
|
+
|
|
7
|
+
## 5.2.0-canary.18
|
|
8
|
+
|
|
9
|
+
## 5.2.0-canary.17
|
|
10
|
+
|
|
11
|
+
## 5.2.0-canary.16
|
|
12
|
+
|
|
13
|
+
## 5.2.0-canary.15
|
|
14
|
+
|
|
15
|
+
## 5.2.0-canary.14
|
|
16
|
+
|
|
17
|
+
## 5.2.0-canary.13
|
|
18
|
+
|
|
19
|
+
## 5.2.0-canary.12
|
|
20
|
+
|
|
21
|
+
## 5.2.0-canary.11
|
|
22
|
+
|
|
23
|
+
## 5.2.0-canary.10
|
|
24
|
+
|
|
25
|
+
## 5.2.0-canary.9
|
|
26
|
+
|
|
3
27
|
## 5.2.0-canary.8
|
|
4
28
|
|
|
5
29
|
## 5.2.0-canary.7
|
package/Config.graphqls
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
extend input GraphCommerceConfig {
|
|
2
|
+
"""
|
|
3
|
+
The Google Tagmanager ID to be used on the site.
|
|
4
|
+
|
|
5
|
+
This value is required even if you are configuring different values for each locale.
|
|
6
|
+
"""
|
|
7
|
+
googleTagmanagerId: String
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
extend input GraphCommerceI18nConfig {
|
|
11
|
+
"""
|
|
12
|
+
The Google Tagmanager ID to be used per locale.
|
|
13
|
+
"""
|
|
14
|
+
googleTagmanagerId: String
|
|
15
|
+
}
|
package/README.md
CHANGED
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
This package makes it easy to add Google Tag Manager to your GraphCommerce
|
|
4
4
|
webshop.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## Configuration
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
2. Add `<GoogleTagManagerScript/>` to your `pages/_app.tsx` file.
|
|
11
|
-
[example](../../examples/magento-graphcms/pages/_app.tsx)
|
|
12
|
-
3. Add `<GoogleTagManagerNoScript/>` to your `pages/_document.tsx` file, in the
|
|
13
|
-
body section above `<Main />`
|
|
14
|
-
[example](../../examples/magento-graphcms/pages/_document_.tsx)
|
|
8
|
+
Configure the following ([configuration values](./Config.graphqls)) in your
|
|
9
|
+
graphcommerce.config.js
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useRouter } from 'next/router'
|
|
2
2
|
import Script from 'next/script'
|
|
3
3
|
import { useEffect } from 'react'
|
|
4
|
+
import { useGoogleTagmanagerId } from '../hooks/useGoogleTagmanagerId'
|
|
4
5
|
|
|
5
6
|
export function GoogleTagManagerScript() {
|
|
6
|
-
const id =
|
|
7
|
+
const id = useGoogleTagmanagerId()
|
|
7
8
|
|
|
8
9
|
const router = useRouter()
|
|
9
10
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/googletagmanager",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "6.0.0-canary.20",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "6.0.0-canary.20",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "6.0.0-canary.20",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "6.0.0-canary.20",
|
|
18
18
|
"@types/gapi.client.tagmanager": "^2.0.2"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/magento-product": "
|
|
21
|
+
"@graphcommerce/magento-product": "6.0.0-canary.20"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"next": "^13.1.1",
|