Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add posthog identity and exclude some path #5969

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export const onClientEntry = () => {
{
api_host: "https://us.i.posthog.com",
person_profiles: "always",
autocapture: {
url_ignorelist: ["community/newcomers", "/calendar", "/newcomers"]
}
}
);
}
Expand Down
9 changes: 9 additions & 0 deletions src/sections/General/Navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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);
Expand Down
Loading