diff --git a/.changeset/lovely-ants-itch.md b/.changeset/lovely-ants-itch.md new file mode 100644 index 0000000000..f58e74ba6d --- /dev/null +++ b/.changeset/lovely-ants-itch.md @@ -0,0 +1,6 @@ +--- +"@khanacademy/perseus": patch +"@khanacademy/perseus-core": patch +--- + +Updating event data sent within interactive graph diff --git a/packages/perseus-core/src/analytics.ts b/packages/perseus-core/src/analytics.ts index daad1389ef..da9f1471d5 100644 --- a/packages/perseus-core/src/analytics.ts +++ b/packages/perseus-core/src/analytics.ts @@ -29,6 +29,8 @@ export type PerseusAnalyticsEvent = type: "perseus:interactive-graph-widget:rendered"; payload: { type: string; + widgetType: string; + widgetId: string; }; } | { diff --git a/packages/perseus/src/widgets/interactive-graphs/mafs-graph.tsx b/packages/perseus/src/widgets/interactive-graphs/mafs-graph.tsx index 35dd7ddfbc..c4cf8ef643 100644 --- a/packages/perseus/src/widgets/interactive-graphs/mafs-graph.tsx +++ b/packages/perseus/src/widgets/interactive-graphs/mafs-graph.tsx @@ -119,7 +119,11 @@ export const MafsGraph = (props: MafsGraphProps) => { useOnMountEffect(() => { analytics.onAnalyticsEvent({ type: "perseus:interactive-graph-widget:rendered", - payload: {type}, + payload: { + type, + widgetType: "INTERACTIVE_GRAPH", + widgetId: "interactive-graph", + }, }); });