Added Google Analytics
This commit is contained in:
parent
a55c0575fe
commit
02b04da10d
7
package-lock.json
generated
7
package-lock.json
generated
@ -18,6 +18,7 @@
|
||||
"framer-motion": "^12.4.7",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-ga4": "^2.1.0",
|
||||
"react-icons": "^5.5.0",
|
||||
"react-particles": "^2.12.2",
|
||||
"react-responsive": "^10.0.0",
|
||||
@ -18874,6 +18875,12 @@
|
||||
"integrity": "sha512-SN/U6Ytxf1QGkw/9ve5Y+NxBbZM6Ht95tuXNMKs8EJyFa/Vy/+Co3stop3KBHARfn/giv+Lj1uUnTfOJ3moFEQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"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==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-icons": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz",
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
"framer-motion": "^12.4.7",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-ga4": "^2.1.0",
|
||||
"react-icons": "^5.5.0",
|
||||
"react-particles": "^2.12.2",
|
||||
"react-responsive": "^10.0.0",
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import ReactGA from "react-ga4";
|
||||
import { Layout, Space } from "antd";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
@ -24,6 +25,8 @@ const App = () => {
|
||||
|
||||
const isMobile = useMediaQuery({ maxWidth: 600 });
|
||||
|
||||
ReactGA.initialize(GA_MEASUREMENT_ID);
|
||||
|
||||
// Get the query parameter from the URL
|
||||
const getQueryParam = (param) => {
|
||||
const searchParams = new URLSearchParams(location.search); // Use location.search directly
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
* Environment Variables
|
||||
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
||||
*/
|
||||
// "vars": { "MY_VARIABLE": "production_value" },
|
||||
"vars": { "GA_MEASUREMENT_ID": "G-MN5S04W1HB" },
|
||||
/**
|
||||
* Note: Use secrets to store sensitive data.
|
||||
* https://developers.cloudflare.com/workers/configuration/secrets/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user