@graphcommerce/googletagmanager 1.0.7 → 2.0.0

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,63 +1,64 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
3
+ ## 2.0.0
5
4
 
6
- ## [1.0.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googletagmanager@0.3.2...@graphcommerce/googletagmanager@1.0.1) (2021-11-03)
5
+ ### Major Changes
7
6
 
7
+ - [#1258](https://github.com/ho-nl/m2-pwa/pull/1258)
8
+ [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)
9
+ Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
8
10
 
9
- ### Bug Fixes
11
+ All notable changes to this project will be documented in this file. See
12
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
10
13
 
11
- * simplified google tagmanager and create 1.0.0 ([21ac284](https://github.com/ho-nl/m2-pwa/commit/21ac28484de6c12d54f6cf73ad04e459d74892a7))
14
+ ## [1.0.8](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googletagmanager@1.0.7...@graphcommerce/googletagmanager@1.0.8) (2021-12-20)
12
15
 
16
+ ### Bug Fixes
13
17
 
18
+ - make sure we're not loading gogole properties when keys are not given
19
+ ([8636715](https://github.com/ho-nl/m2-pwa/commit/8636715d61985e0919208ffb64354c3ebb43ed01))
14
20
 
21
+ ## [1.0.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googletagmanager@0.3.2...@graphcommerce/googletagmanager@1.0.1) (2021-11-03)
15
22
 
23
+ ### Bug Fixes
16
24
 
17
- # [0.3.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googletagmanager@0.2.10...@graphcommerce/googletagmanager@0.3.0) (2021-10-27)
25
+ - simplified google tagmanager and create 1.0.0
26
+ ([21ac284](https://github.com/ho-nl/m2-pwa/commit/21ac28484de6c12d54f6cf73ad04e459d74892a7))
18
27
 
28
+ # [0.3.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googletagmanager@0.2.10...@graphcommerce/googletagmanager@0.3.0) (2021-10-27)
19
29
 
20
30
  ### Features
21
31
 
22
- * **nextjs:** upgraded to nextjs 12 ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
23
-
24
-
25
-
26
-
32
+ - **nextjs:** upgraded to nextjs 12
33
+ ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
27
34
 
28
35
  ## [0.2.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googletagmanager@0.2.0...@graphcommerce/googletagmanager@0.2.1) (2021-09-27)
29
36
 
30
37
  **Note:** Version bump only for package @graphcommerce/googletagmanager
31
38
 
32
-
33
-
34
-
35
-
36
39
  # 0.2.0 (2021-09-27)
37
40
 
38
-
39
41
  ### Bug Fixes
40
42
 
41
- * use gtm id directly from process.env ([1682834](https://github.com/ho-nl/m2-pwa/commit/16828342b0f432da5c7051b1b9834fdad1c58ec8))
42
-
43
+ - use gtm id directly from process.env
44
+ ([1682834](https://github.com/ho-nl/m2-pwa/commit/16828342b0f432da5c7051b1b9834fdad1c58ec8))
43
45
 
44
46
  ### Features
45
47
 
46
- * no gtm id present warning ([94cda8a](https://github.com/ho-nl/m2-pwa/commit/94cda8a30a3ec556d3e5484824fbf349e2e1e342))
47
- * renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of [@reachdigital](https://github.com/reachdigital) ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
48
-
49
-
50
-
51
-
48
+ - no gtm id present warning
49
+ ([94cda8a](https://github.com/ho-nl/m2-pwa/commit/94cda8a30a3ec556d3e5484824fbf349e2e1e342))
50
+ - renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of
51
+ [@reachdigital](https://github.com/reachdigital)
52
+ ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
52
53
 
53
54
  # 0.1.0 (2021-09-22)
54
55
 
55
-
56
56
  ### Bug Fixes
57
57
 
58
- * use gtm id directly from process.env ([1682834](https://github.com/ho-nl/m2-pwa/commit/16828342b0f432da5c7051b1b9834fdad1c58ec8))
59
-
58
+ - use gtm id directly from process.env
59
+ ([1682834](https://github.com/ho-nl/m2-pwa/commit/16828342b0f432da5c7051b1b9834fdad1c58ec8))
60
60
 
61
61
  ### Features
62
62
 
63
- * no gtm id present warning ([94cda8a](https://github.com/ho-nl/m2-pwa/commit/94cda8a30a3ec556d3e5484824fbf349e2e1e342))
63
+ - no gtm id present warning
64
+ ([94cda8a](https://github.com/ho-nl/m2-pwa/commit/94cda8a30a3ec556d3e5484824fbf349e2e1e342))
@@ -1,6 +1,8 @@
1
1
  import React from 'react'
2
2
 
3
3
  export default function GoogleTagManagerNoScript() {
4
+ if (!process.env.NEXT_PUBLIC_GTM_ID) return null
5
+
4
6
  return (
5
7
  <noscript>
6
8
  {/* eslint-disable-next-line jsx-a11y/iframe-has-title */}
@@ -23,19 +23,15 @@ export default function GoogleTagManagerScript() {
23
23
  }
24
24
  }, [router.events])
25
25
 
26
+ if (!id) return null
27
+
26
28
  return (
27
- <Script
28
- id={`gtm-${id}`}
29
- strategy='afterInteractive'
30
- dangerouslySetInnerHTML={{
31
- __html: `
32
- (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
33
- new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
34
- j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
35
- 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
36
- })(window,document,'script','dataLayer', '${id}');
37
- `,
38
- }}
39
- />
29
+ <Script id={`gtm-${id}`} strategy='afterInteractive'>{`
30
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
31
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
32
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
33
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
34
+ })(window,document,'script','dataLayer', '${id}');
35
+ `}</Script>
40
36
  )
41
37
  }
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@graphcommerce/googletagmanager",
3
- "version": "1.0.7",
3
+ "version": "2.0.0",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
- "browserslist": [
7
- "extends @graphcommerce/browserslist-config-pwa"
8
- ],
9
6
  "eslintConfig": {
10
7
  "extends": "@graphcommerce/eslint-config-pwa",
11
8
  "parserOptions": {
@@ -13,17 +10,15 @@
13
10
  }
14
11
  },
15
12
  "devDependencies": {
16
- "@graphcommerce/browserslist-config-pwa": "^3.0.3",
17
- "@graphcommerce/eslint-config-pwa": "^3.1.9",
18
- "@graphcommerce/prettier-config-pwa": "^3.0.5",
19
- "@graphcommerce/typescript-config-pwa": "^3.1.2",
20
- "@playwright/test": "^1.17.1",
13
+ "@graphcommerce/eslint-config-pwa": "^4.0.0",
14
+ "@graphcommerce/prettier-config-pwa": "^4.0.0",
15
+ "@graphcommerce/typescript-config-pwa": "^4.0.0",
16
+ "@playwright/test": "^1.18.1",
21
17
  "@types/gapi.client.tagmanager": "^2.0.2"
22
18
  },
23
19
  "dependencies": {
24
- "next": "^12.0.7",
20
+ "next": "^12.0.10",
25
21
  "react": "^17.0.2",
26
22
  "react-dom": "^17.0.2"
27
- },
28
- "gitHead": "06b4426d199de9ec2a9d2ac86d42ab047e59e7e7"
23
+ }
29
24
  }