mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 16:43:56 +03:00
added react google analytics (#108)
* fixes * added react google analytics
This commit is contained in:
1 parent
8f28ba28ec
commit
9d368bcc44
3 files changed
+18
-1
No files matched your search
@@ -65,6 +65,7 @@
|
||||
"qrcode.react": "^0.9.3",
|
||||
"react": "^16.8.6",
|
||||
"react-dom": "^16.8.6",
|
||||
"react-ga": "^2.6.0",
|
||||
"snack-sdk": "^2.3.1",
|
||||
"stringify-object": "^3.3.0",
|
||||
"svg-to-dataurl": "^1.0.0",
|
||||
|
||||
+12
-1
@@ -8,6 +8,14 @@ import NProgress from "nprogress";
|
||||
import { useRouter } from "next/router";
|
||||
import { activeRouteData } from "@utils/routes";
|
||||
|
||||
let reactGa;
|
||||
if (IN_BROWSER) {
|
||||
reactGa = require("react-ga");
|
||||
reactGa.initialize("UA-60624235-8", {
|
||||
debug: IS_DEV
|
||||
});
|
||||
}
|
||||
|
||||
const logo = (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -55,10 +63,13 @@ export default function App({ Component, pageProps }) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
reactGa.pageview(router.pathname);
|
||||
|
||||
const startProgress = () => NProgress.start();
|
||||
|
||||
let timer;
|
||||
const stopProgress = () => {
|
||||
const stopProgress = pathname => {
|
||||
reactGa.pageview(pathname);
|
||||
clearTimeout(timer);
|
||||
NProgress.done();
|
||||
};
|
||||
|
||||
@@ -7810,6 +7810,11 @@ react-fast-compare@^2.0.1:
|
||||
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9"
|
||||
integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==
|
||||
|
||||
react-ga@^2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.6.0.tgz#c3fe830ead2ad25117e1d33280d9698de9b28496"
|
||||
integrity sha512-GWHBWZDFjDGMkIk1LzroIn0mNTygKw3adXuqvGvheFZvlbpqMPbHsQsTdQBIxRRdXGQM/Zq+dQLRPKbwIHMTaw==
|
||||
|
||||
react-is@16.8.6, react-is@^16.7.0, react-is@^16.8.1:
|
||||
version "16.8.6"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
|
||||
|
||||
Reference in new issue
Block a user