From 4a30fb220bd2bc308e5ab861754e56f83b5072f3 Mon Sep 17 00:00:00 2001 From: Sudhanshu Dasgupta Date: Thu, 3 Oct 2024 13:16:45 +0530 Subject: [PATCH] add posthog identity and excllude path Signed-off-by: Sudhanshu Dasgupta --- gatsby-browser.js | 3 +++ src/sections/General/Navigation/index.js | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/gatsby-browser.js b/gatsby-browser.js index d376274137d2..b8de40d7000f 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -35,6 +35,9 @@ export const onClientEntry = () => { { api_host: "https://us.i.posthog.com", person_profiles: "always", + autocapture: { + url_ignorelist: ["community/newcomers", "/calendar", "/newcomers"] + } } ); } diff --git a/src/sections/General/Navigation/index.js b/src/sections/General/Navigation/index.js index 66333ffcba09..31f0f6a193b3 100644 --- a/src/sections/General/Navigation/index.js +++ b/src/sections/General/Navigation/index.js @@ -21,6 +21,7 @@ import CloudIcon from "./utility/CloudIcon.js"; import LogoutIcon from "./utility/LogoutIcon.js"; // import LogoutIcon from "./utility/LogoutIcon.js"; import KanvasIcon from "./utility/KanvasIcon.js"; +import posthog from "posthog-js"; const Navigation = () => { let data = useStaticQuery( graphql` @@ -212,6 +213,14 @@ const Navigation = () => { } const data = response.data; + if (data){ + posthog.identify( + data?.id, + { + email: data?.email + } + ); + } setUserData(data); } catch (error) { console.error("There was a problem with your fetch operation:", error);