1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

feat: make Google Analytics configurable with VITE_GA_ID

This commit is contained in:
qtchaos 2024-02-26 19:40:35 +02:00
parent 02fceb7f8e
commit 0e72829dd7
No known key found for this signature in database
GPG key ID: 7DA98B2B9EF06A90
2 changed files with 8 additions and 6 deletions

View file

@ -2,5 +2,5 @@ export const APP_VERSION = import.meta.env.PACKAGE_VERSION;
export const DISCORD_LINK = "https://discord.gg/gQYB6fGArX"; export const DISCORD_LINK = "https://discord.gg/gQYB6fGArX";
export const GITHUB_LINK = "https://github.com/movie-web/movie-web"; export const GITHUB_LINK = "https://github.com/movie-web/movie-web";
export const DONATION_LINK = "https://ko-fi.com/movieweb"; export const DONATION_LINK = "https://ko-fi.com/movieweb";
export const GA_ID = "G-44YVXRL61C"; export const GA_ID = import.meta.env.VITE_GA_ID;
export const BACKEND_URL = import.meta.env.VITE_BACKEND_URL; export const BACKEND_URL = import.meta.env.VITE_BACKEND_URL;

View file

@ -2,8 +2,10 @@ import ReactGA from "react-ga4";
import { GA_ID } from "@/setup/constants"; import { GA_ID } from "@/setup/constants";
if (GA_ID) {
ReactGA.initialize([ ReactGA.initialize([
{ {
trackingId: GA_ID, trackingId: GA_ID,
}, },
]); ]);
}