Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

seperate scripts

AykutSarac8c940d7e1354
diff --git a/src/components/GoogleAnalytics/index.tsx b/src/components/GoogleAnalytics/index.tsx
new file mode 100644
index 00000000..3d7fe6c2
--- /dev/null
+++ b/src/components/GoogleAnalytics/index.tsx
@@ -0,0 +1,28 @@
+import Script from "next/script";
+import React from "react";
+import * as gtag from "src/utils/gtag";
+
+export const GoogleAnalytics: React.FC = () => {
+ return (
+ <>
+ <Script
+ strategy="afterInteractive"
+ src={`https://www.googletagmanager.com/gtag/js?id=${gtag.GA_TRACKING_ID}`}
+ />
+ <Script
+ id="gtag-init"
+ strategy="afterInteractive"
+ dangerouslySetInnerHTML={{
+ __html: `
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+ gtag('config', '${gtag.GA_TRACKING_ID}', {
+ page_path: window.location.pathname,
+ });
+ `,
+ }}
+ />
+ </>
+ );
+};