@graphcommerce/googletagmanager 8.0.4-canary.0 → 8.0.4

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,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+ ([@mikekeehnen](https://github.com/mikekeehnen))
9
+
10
+ ## 8.0.4-canary.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [#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.
15
+ ([@mikekeehnen](https://github.com/mikekeehnen))
16
+
3
17
  ## 8.0.4-canary.0
4
18
 
5
19
  ## 8.0.3
@@ -1,23 +1,10 @@
1
1
  import { useStorefrontConfig } from '@graphcommerce/next-ui'
2
- import { useRouter } from 'next/router'
3
2
  import Script from 'next/script'
4
- import { useEffect } from 'react'
5
3
 
6
4
  export function GoogleTagManagerScript() {
7
- const { events } = useRouter()
8
5
  const id =
9
6
  useStorefrontConfig().googleTagmanagerId ?? import.meta.graphCommerce.googleTagmanagerId
10
7
 
11
- useEffect(() => {
12
- const onRouteChangeComplete = (url: string) => {
13
- const dataLayer = globalThis.dataLayer as Record<string, unknown>[] | undefined
14
- dataLayer?.push({ event: 'pageview', page: url })
15
- }
16
-
17
- events.on('routeChangeComplete', onRouteChangeComplete)
18
- return () => events.off('routeChangeComplete', onRouteChangeComplete)
19
- }, [events])
20
-
21
8
  return (
22
9
  <>
23
10
  <Script id={`gtm-${id}`} strategy='afterInteractive'>{`
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": "8.0.4-canary.0",
5
+ "version": "8.0.4",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -11,14 +11,18 @@
11
11
  "project": "./tsconfig.json"
12
12
  }
13
13
  },
14
+ "dependencies": {
15
+ "@graphcommerce/google-datalayer": "8.0.4"
16
+ },
14
17
  "devDependencies": {
15
18
  "@types/gapi.client.tagmanager": "^2.0.4"
16
19
  },
17
20
  "peerDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "^8.0.4-canary.0",
19
- "@graphcommerce/next-ui": "^8.0.4-canary.0",
20
- "@graphcommerce/prettier-config-pwa": "^8.0.4-canary.0",
21
- "@graphcommerce/typescript-config-pwa": "^8.0.4-canary.0",
21
+ "@graphcommerce/eslint-config-pwa": "^8.0.4",
22
+ "@graphcommerce/next-ui": "^8.0.4",
23
+ "@graphcommerce/prettier-config-pwa": "^8.0.4",
24
+ "@graphcommerce/typescript-config-pwa": "^8.0.4",
25
+ "@mui/material": "^5.10.16",
22
26
  "next": "*",
23
27
  "react": "^18.2.0",
24
28
  "react-dom": "^18.2.0"