From 9bd21f0c0cd1b11dea4cc5464967866e1fe0244f Mon Sep 17 00:00:00 2001 From: Bob Carmichael Date: Sun, 15 Oct 2023 11:23:32 -0400 Subject: [PATCH 1/2] try to get google analytics working again --- package-lock.json | 14 +++++--------- package.json | 2 +- src/features/app/reactGA.js | 7 ++----- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5320bb1..d80c20d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "react-bootstrap": "^2.8.0", "react-dom": "^18.2", "react-error-boundary": "^4.0.11", - "react-ga": "^3.3.1", + "react-ga4": "^2.1.0", "react-icons": "^4.2.0", "react-konva": "^18.2.10", "react-redux": "^8.1.2", @@ -12090,14 +12090,10 @@ "react": ">=16.13.1" } }, - "node_modules/react-ga": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/react-ga/-/react-ga-3.3.1.tgz", - "integrity": "sha512-4Vc0W5EvXAXUN/wWyxvsAKDLLgtJ3oLmhYYssx+YzphJpejtOst6cbIHCIyF50Fdxuf5DDKqRYny24yJ2y7GFQ==", - "peerDependencies": { - "prop-types": "^15.6.0", - "react": "^15.6.2 || ^16.0 || ^17 || ^18" - } + "node_modules/react-ga4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-2.1.0.tgz", + "integrity": "sha512-ZKS7PGNFqqMd3PJ6+C2Jtz/o1iU9ggiy8Y8nUeksgVuvNISbmrQtJiZNvC/TjDsqD0QlU5Wkgs7i+w9+OjHhhQ==" }, "node_modules/react-icons": { "version": "4.11.0", diff --git a/package.json b/package.json index d6445dda..f96ff960 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "react-bootstrap": "^2.8.0", "react-dom": "^18.2", "react-error-boundary": "^4.0.11", - "react-ga": "^3.3.1", + "react-ga4": "^2.1.0", "react-icons": "^4.2.0", "react-konva": "^18.2.10", "react-redux": "^8.1.2", diff --git a/src/features/app/reactGA.js b/src/features/app/reactGA.js index 983b08e9..8e05c354 100644 --- a/src/features/app/reactGA.js +++ b/src/features/app/reactGA.js @@ -1,6 +1,3 @@ -import ReactGA from "react-ga" +import ReactGA from "react-ga4" -ReactGA.initialize("UA-126702426-1", { - debug: false, // Set to true to see debug info in the console -}) -ReactGA.pageview(window.location.pathname + window.location.search) +ReactGA.initialize("UA-126702426-1") From 1a365547d67255430e3e9f861a40a4dbc4834be4 Mon Sep 17 00:00:00 2001 From: Bob Carmichael Date: Sun, 15 Oct 2023 11:27:04 -0400 Subject: [PATCH 2/2] fix tests --- src/setupTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setupTests.js b/src/setupTests.js index 936f7ec9..435d6279 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -1,3 +1,3 @@ import "jest-canvas-mock" -jest.mock("react-ga") +jest.mock("react-ga4")