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 02a0581
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 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,19 +81,19 @@ 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(() => {
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 02a0581

Please sign in to comment.