From 54c3652c999c7ee11eaeffc1dcd10249fcd96ed5 Mon Sep 17 00:00:00 2001 From: knuthtimo-lab Date: Sun, 25 Jan 2026 22:28:47 +0100 Subject: [PATCH 1/6] Werbung --- src/app/(main)/(marketing)/layout.tsx | 10 +++++++++ src/app/(main)/(marketing)/tools/layout.tsx | 2 +- src/app/(marketing-de)/layout.tsx | 12 ++++++++++ src/components/ads/AdBanner.tsx | 25 +++++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/app/(main)/(marketing)/layout.tsx b/src/app/(main)/(marketing)/layout.tsx index afe84e7..3a88745 100644 --- a/src/app/(main)/(marketing)/layout.tsx +++ b/src/app/(main)/(marketing)/layout.tsx @@ -1,4 +1,5 @@ import type { Metadata } from 'next'; +import AdBanner from '@/components/ads/AdBanner'; import '@/styles/globals.css'; import { Providers } from '@/components/Providers'; import MarketingLayout from './MarketingLayout'; @@ -61,6 +62,15 @@ export default function MarketingGroupLayout({ {children} + {/* Global Marketing Ad - Exclusions handled in AdBanner */} +
+ +
); } diff --git a/src/app/(main)/(marketing)/tools/layout.tsx b/src/app/(main)/(marketing)/tools/layout.tsx index 8141639..4abcf02 100644 --- a/src/app/(main)/(marketing)/tools/layout.tsx +++ b/src/app/(main)/(marketing)/tools/layout.tsx @@ -19,7 +19,7 @@ export default function ToolsLayout({ {/* AdBanner handles its own visibility - only shows when an ad is filled */}
{children} + + {/* Global Marketing Ad - Exclusions handled in AdBanner */} +
+ +
diff --git a/src/components/ads/AdBanner.tsx b/src/components/ads/AdBanner.tsx index 9443b25..ee7e79d 100644 --- a/src/components/ads/AdBanner.tsx +++ b/src/components/ads/AdBanner.tsx @@ -3,6 +3,8 @@ import { useEffect, useState, useRef } from 'react'; import { useSession } from 'next-auth/react'; +import { usePathname } from 'next/navigation'; + interface AdBannerProps { dataAdSlot: string; dataAdFormat?: string; @@ -17,9 +19,30 @@ export default function AdBanner({ className = '', }: AdBannerProps) { const { data: session, status } = useSession(); + const pathname = usePathname(); const adRef = useRef(null); const [adFilled, setAdFilled] = useState(false); + // Paths where ads should NOT be shown + const excludedPaths = [ + '/', // English Home + '/de', // German Home + '/qr-code-erstellen', // German Landing + '/contact', // Contact + '/about', // About + '/legal', // Legal pages + '/privacy', + '/terms', + '/cookie-policy', + '/impressum', + ]; + + // Check if current path matches strictly or starts with excluded path (for nested legal/blog pages if needed, though mostly exact matches here) + const shouldExclude = excludedPaths.some(path => { + if (path === '/') return pathname === '/'; + return pathname === path || pathname?.startsWith(`${path}/`); + }); + // Check if user has a paid plan const isPaidUser = session?.user && ( session.user.plan === 'PRO' || @@ -27,6 +50,8 @@ export default function AdBanner({ session.user.plan === 'LIFETIME' ); + if (shouldExclude) return null; + useEffect(() => { // Don't load if loading session or if user is paid if (status === 'loading' || isPaidUser) return; From 7e894bf65ee772e69b74e17ab2a91057057f7689 Mon Sep 17 00:00:00 2001 From: knuthtimo-lab Date: Sun, 25 Jan 2026 23:10:03 +0100 Subject: [PATCH 2/6] facebook --- package-lock.json | 7 ++++ package.json | 1 + src/app/(marketing-de)/layout.tsx | 7 ++++ src/components/analytics/FacebookPixel.tsx | 38 ++++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 src/components/analytics/FacebookPixel.tsx diff --git a/package-lock.json b/package-lock.json index f35bbaa..bf44758 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,6 +46,7 @@ "react-chartjs-2": "^5.2.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", + "react-facebook-pixel": "^1.0.4", "react-i18next": "^13.5.0", "react-simple-maps": "^3.0.0", "resend": "^6.4.2", @@ -10436,6 +10437,12 @@ "react": ">= 16.8 || 18.0.0" } }, + "node_modules/react-facebook-pixel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/react-facebook-pixel/-/react-facebook-pixel-1.0.4.tgz", + "integrity": "sha512-givZY8MS0v/mdbRzvcvouBo/j0TtDiu/93f4gIjJXwDDgwlf6bYUiQvb2qcqjluOOD/hIKUQHNYLNsSOnoEklg==", + "license": "MIT" + }, "node_modules/react-i18next": { "version": "13.5.0", "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-13.5.0.tgz", diff --git a/package.json b/package.json index c42cf7a..a8c069d 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "react-chartjs-2": "^5.2.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", + "react-facebook-pixel": "^1.0.4", "react-i18next": "^13.5.0", "react-simple-maps": "^3.0.0", "resend": "^6.4.2", diff --git a/src/app/(marketing-de)/layout.tsx b/src/app/(marketing-de)/layout.tsx index 903706b..3f43d1c 100644 --- a/src/app/(marketing-de)/layout.tsx +++ b/src/app/(marketing-de)/layout.tsx @@ -5,6 +5,7 @@ import { Providers } from '@/components/Providers'; import MarketingDeLayout from './MarketingDeLayout'; import { organizationSchema, websiteSchema } from '@/lib/schema'; import AdSenseScript from '@/components/ads/AdSenseScript'; +import FacebookPixel from '@/components/analytics/FacebookPixel'; export const metadata: Metadata = { title: { @@ -49,6 +50,11 @@ export const metadata: Metadata = { 'de': 'https://www.qrmaster.net/qr-code-erstellen', }, }, + verification: { + other: { + 'facebook-domain-verification': process.env.NEXT_PUBLIC_FACEBOOK_DOMAIN_VERIFICATION || '', + }, + }, }; import AdBanner from '@/components/ads/AdBanner'; // Import AdBanner @@ -64,6 +70,7 @@ export default function MarketingDeGroupLayout({ +