diff --git a/src/gurubase-frontend/next.config.mjs b/src/gurubase-frontend/next.config.mjs index 52f0abe..e517230 100644 --- a/src/gurubase-frontend/next.config.mjs +++ b/src/gurubase-frontend/next.config.mjs @@ -79,7 +79,7 @@ const nextConfig = { "frame-src 'self' *.auth0.com *.hotjar.com", process.env.NEXT_PUBLIC_NODE_ENV === "selfhosted" ? "connect-src 'self' *" - : "connect-src 'self' localhost:* 127.0.0.1:* gurubase-backend:* *.getanteon.com *.amazonaws.com *.jsdelivr.net *.auth0.com *.iconify.design *.unisvg.com *.simplesvg.com *.hotjar.com *.hotjar.io wss://*.hotjar.com *.mixpanel.com *.google-analytics.com *.analytics.google.com", + : "connect-src 'self' localhost:* 127.0.0.1:* gurubase-backend:* *.getanteon.com *.amazonaws.com *.jsdelivr.net *.auth0.com *.iconify.design *.unisvg.com *.simplesvg.com *.hotjar.com *.hotjar.io wss://*.hotjar.com *.mixpanel.com *.google-analytics.com *.analytics.google.com *.sentry.io *.ingest.sentry.io", "form-action 'self' *.auth0.com", "object-src 'none'", "base-uri 'self'", diff --git a/src/gurubase-frontend/src/components/HomePageClient.js b/src/gurubase-frontend/src/components/HomePageClient.js index bd4ac2d..6e02150 100644 --- a/src/gurubase-frontend/src/components/HomePageClient.js +++ b/src/gurubase-frontend/src/components/HomePageClient.js @@ -1,9 +1,9 @@ "use client"; import React, { useEffect, useState } from "react"; - import Footer from "@/components/Footer"; import GuruList from "@/components/GuruList"; import Header from "@/components/Header/index"; +import mixpanel from "mixpanel-browser"; export default function HomePageClient({ allGuruTypes }) { // check the environment development or production diff --git a/src/gurubase-frontend/src/components/ResultClient.js b/src/gurubase-frontend/src/components/ResultClient.js index 74449b2..5c49dad 100644 --- a/src/gurubase-frontend/src/components/ResultClient.js +++ b/src/gurubase-frontend/src/components/ResultClient.js @@ -31,6 +31,7 @@ import { } from "@/redux/slices/mainFormSlice"; import { bingeRedirection } from "@/utils/bingeRedirection"; import { getStream } from "@/utils/clientActions"; +import mixpanel from "mixpanel-browser"; export const ResultClient = ({ isHelpful, @@ -143,18 +144,18 @@ export const ResultClient = ({ // // ); // }, [fingerprint]); - // useEffect(() => { - // if (!slug || typeof window === "undefined" || fingerprint) { - // return; - // } - // if (process.env.NEXT_PUBLIC_MIXPANEL_TOKEN) { - // mixpanel.init(process.env.NEXT_PUBLIC_MIXPANEL_TOKEN, { debug: false }); - // mixpanel.track("Slug Visited", { - // slug: slug, - // guruType: guruType - // }); - // } - // }, []); + useEffect(() => { + if (!slug || typeof window === "undefined" || fingerprint) { + return; + } + if (process.env.NEXT_PUBLIC_MIXPANEL_TOKEN) { + mixpanel.init(process.env.NEXT_PUBLIC_MIXPANEL_TOKEN, { debug: false }); + mixpanel.track("Slug Visited", { + slug: slug, + guruType: guruType + }); + } + }, []); const [question, setQuestion] = useState(instantQuestion || reduxQuestion); const [description, setDescription] = useState(