From 82b389281d4802386bf0f454d250af97ac22cbcf Mon Sep 17 00:00:00 2001 From: Jon McClure Date: Fri, 14 Jun 2024 12:28:33 +0100 Subject: [PATCH] hotfix for chartbeat registering virtual pages --- src/components/Analytics/providers/chartbeat.ts | 2 +- src/globals.d.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Analytics/providers/chartbeat.ts b/src/components/Analytics/providers/chartbeat.ts index 4d88c65c..60be5d98 100644 --- a/src/components/Analytics/providers/chartbeat.ts +++ b/src/components/Analytics/providers/chartbeat.ts @@ -34,7 +34,7 @@ export default (authors: { name: string }[]) => { export const registerPageview = () => { if (typeof window === 'undefined' || !window.pSUPERFLY) return; - window.pSUPERFLY({ + window.pSUPERFLY.virtualPage({ path: window.location.pathname, title: document?.title, }); diff --git a/src/globals.d.ts b/src/globals.d.ts index 8c36939d..d0c559ce 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -16,7 +16,9 @@ declare global { /** Chartbeat config */ _sf_async_config: ChartbeatConfig, /** Chartbeat method */ - pSUPERFLY: (config: { path: string, title: string }) => void, + pSUPERFLY: { + virtualPage: (config: { path: string, title: string }) => void, + }, /** Graphics ads */ graphicsAdQueue: any[], }