Add telemetry to frontend

This commit is contained in:
Vladyslav Matsiiako
2022-11-25 16:08:56 -05:00
parent d70d1f23d8
commit 22e7137e74
7 changed files with 35 additions and 14 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import { publicPaths } from "../const.js";
import { useEffect } from "react";
import { useRouter } from "next/router";
import { initPostHog } from "../components/analytics/posthog";
import { ENV } from "../components/utilities/config";
config.autoAddCss = false;
@@ -20,7 +21,7 @@ const App = ({ Component, pageProps, ...appProps }) => {
const handleRouteChange = () => {
if (typeof window !== "undefined") {
if (process.env.NEXT_PUBLIC_ENV == "production") {
if (ENV == "production") {
posthog.capture("$pageview");
}
}
+3 -2
View File
@@ -4,6 +4,7 @@ import Plan from "../../../components/billing/Plan";
import getOrganizationSubscriptions from "../../api/organization/GetOrgSubscription"
import getOrganizationUsers from "../../api/organization/GetOrgUsers"
import NavHeader from "../../../components/navigation/NavHeader";
import { STRIPE_PRODUCT_PRO, STRIPE_PRODUCT_STARTER } from "../../../components/utilities/config";
export default function SettingsBilling() {
@@ -20,7 +21,7 @@ export default function SettingsBilling() {
subtext: "$5 per member/month afterwards.",
buttonTextMain: "Downgrade",
buttonTextSecondary: "Learn More",
current: currentPlan == process.env.NEXT_PUBLIC_STRIPE_PRODUCT_STARTER,
current: currentPlan == STRIPE_PRODUCT_STARTER,
},
{
key: 2,
@@ -31,7 +32,7 @@ export default function SettingsBilling() {
text: "Keep up with key management as you grow.",
buttonTextMain: "Upgrade",
buttonTextSecondary: "Learn More",
current: currentPlan == process.env.NEXT_PUBLIC_STRIPE_PRODUCT_PRO,
current: currentPlan == STRIPE_PRODUCT_PRO,
},
{
key: 3,