Skip to content

Commit

Permalink
Test case with Kapa removal
Browse files Browse the repository at this point in the history
  • Loading branch information
eerikson committed Jun 3, 2024
1 parent 9885de7 commit b20d94a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useEffect } from "react";
import { insertGTMScriptTags } from "../components/GTMScripts";
import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import { KapaEventNames } from "../utils/constants";
// import { KapaEventNames } from "../utils/constants";
import { track, DocsAIPrefix } from "../utils/tracking";

export type URLSearchGet = string | null;
Expand Down Expand Up @@ -81,20 +81,20 @@ export default function MyApp({ Component, pageProps }: AppProps) {
useEffect(() => {
insertGTMScriptTags();
trackPageview();
Object.values(KapaEventNames).forEach((eventName) => {
// @ts-ignore
Kapa(eventName, function (args) {
// prefix kapa's property names to distinguish them from mixpanel's
const properties = {};
if (args) {
Object.keys(args).forEach((keyName) => {
properties[`${DocsAIPrefix} ${keyName}`] = args[keyName];
})
}
track(`${DocsAIPrefix} ${eventName}`, properties);
});
})
}, []);
// Object.values(KapaEventNames).forEach((eventName) => {
// // @ts-ignore
// Kapa(eventName, function (args) {
// // prefix kapa's property names to distinguish them from mixpanel's
// const properties = {};
// if (args) {
// Object.keys(args).forEach((keyName) => {
// properties[`${DocsAIPrefix} ${keyName}`] = args[keyName];
// })
// }
// track(`${DocsAIPrefix} ${eventName}`, properties);
// });
// })
// }, []);

useEffect(() => {
router.events.on(`routeChangeComplete`, trackPageview);
Expand Down
4 changes: 2 additions & 2 deletions pages/_document.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b20d94a

Please sign in to comment.