Skip to content

Commit

Permalink
added test tracking event
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Ross committed Mar 19, 2024
1 parent a6ef158 commit 5f61252
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pages/[...filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { componentRenderer } from "@/components/blocks/mdxComponentRenderer";
import { useAppInsightsContext } from "@microsoft/applicationinsights-react-js";
import { InferGetStaticPropsType } from "next";
import { useReportWebVitals } from "next/web-vitals";
import { useEffect } from "react";
import { tinaField, useTina } from "tinacms/dist/react";
import { TinaMarkdown } from "tinacms/dist/rich-text";
import { client } from "../.tina/__generated__/client";
Expand Down Expand Up @@ -41,6 +42,12 @@ export default function HomePage(
}
});

useEffect(() => {
appInsights.trackMetric({ name: "TEST_EVENT", average: 42 }, {});
// eslint-disable-next-line no-console
console.log("appInsights", appInsights);
}, [appInsights]);

// Here due to components attempting to access pageBlock items before
// they are initialised
if (!pageBlocks) {
Expand Down

0 comments on commit 5f61252

Please sign in to comment.