mirror of
https://git.atakanozban.com/Songs2VID/songs2vid.git
synced 2026-10-04 10:38:32 +02:00
29 lines
883 B
TypeScript
29 lines
883 B
TypeScript
import Script from "next/script";
|
|
|
|
/** Primary GA4 property (songs2vid.com). */
|
|
const GA_MEASUREMENT_ID = "G-9XCHRS7LJR";
|
|
/** Additional GA4 property — both must remain configured. */
|
|
const GA_MEASUREMENT_ID_SECONDARY = "G-2V3FSMMPQX";
|
|
|
|
/**
|
|
* Google Analytics 4 (gtag.js) for songs2vid.com / songs2yt.com.
|
|
* Loaded once from the root layout; both measurement IDs stay active.
|
|
*/
|
|
export function GoogleAnalytics() {
|
|
return (
|
|
<>
|
|
<Script
|
|
src={`https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`}
|
|
strategy="afterInteractive"
|
|
/>
|
|
<Script id="google-analytics" strategy="afterInteractive">{`
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
gtag('config', '${GA_MEASUREMENT_ID}');
|
|
gtag('config', '${GA_MEASUREMENT_ID_SECONDARY}');
|
|
`}</Script>
|
|
</>
|
|
);
|
|
}
|