Skip to content

Commit

Permalink
Merge pull request #41 from game-node-app/dev
Browse files Browse the repository at this point in the history
add dev env check to matomo tracker
  • Loading branch information
Lamarcke authored Mar 19, 2024
2 parents b86f998 + 4d99cbb commit 1a004e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/general/MatomoTracker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Link from "next/link";

const MATOMO_URL = process.env.NEXT_PUBLIC_MATOMO_URL;
const MATOMO_SITE_ID = process.env.NEXT_PUBLIC_MATOMO_SITE_ID;
const IS_DEV_ENV = process.env.NODE_ENV !== "production";

const MatomoTracker = () => {
const [hasAcceptedCookies, setHasAcceptedCookies] =
Expand Down Expand Up @@ -57,7 +58,7 @@ const MatomoTracker = () => {
}, [hasAcceptedCookies, showCookieConsentNotification]);

useEffect(() => {
if (MATOMO_URL && MATOMO_SITE_ID) {
if (!IS_DEV_ENV && MATOMO_URL && MATOMO_SITE_ID) {
init({
url: MATOMO_URL,
siteId: MATOMO_SITE_ID,
Expand Down

0 comments on commit 1a004e7

Please sign in to comment.