Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(frontend): setup DataFast analytics (#11182)

Ubbe271a520afaae
diff --git a/autogpt_platform/frontend/src/app/layout.tsx b/autogpt_platform/frontend/src/app/layout.tsx
index 77973a54e6..258a08a9bd 100644
--- a/autogpt_platform/frontend/src/app/layout.tsx
+++ b/autogpt_platform/frontend/src/app/layout.tsx
@@ -11,6 +11,8 @@ import { Toaster } from "@/components/molecules/Toast/toaster";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { Analytics } from "@vercel/analytics/next";
+import { headers } from "next/headers";
+import Script from "next/script";
export const metadata: Metadata = {
title: "AutoGPT Platform",
@@ -22,6 +24,9 @@ export default async function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
+ const headersList = await headers();
+ const host = headersList.get("host") || "";
+ const isPlatformDomain = host === "platform.agpt.co";
return (
<html
lang="en"
@@ -32,6 +37,14 @@ export default async function RootLayout({
<GoogleAnalytics
gaId={process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID || "G-FH2XK2W4GN"} // This is the measurement Id for the Google Analytics dev project
/>
+ {isPlatformDomain && (
+ <Script
+ strategy="afterInteractive"
+ data-website-id="dfid_g5wtBIiHUwSkWKcGz80lu"
+ data-domain="agpt.co"
+ src="https://datafa.st/js/script.js"
+ />
+ )}
</head>
<body>
<Providers