From 5f612528712369824fc07db4e1d4112fc3c286b9 Mon Sep 17 00:00:00 2001 From: Harry Ross Date: Tue, 19 Mar 2024 14:27:58 +1100 Subject: [PATCH] added test tracking event --- pages/[...filename].tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pages/[...filename].tsx b/pages/[...filename].tsx index cb7dc310da..8fc2693d5c 100644 --- a/pages/[...filename].tsx +++ b/pages/[...filename].tsx @@ -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"; @@ -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) {