hotfix for chartbeat registering virtual pages

This commit is contained in:
Jon McClure 2024-06-14 12:28:33 +01:00
parent d902cb89e6
commit 82b389281d
2 changed files with 4 additions and 2 deletions

View file

@ -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,
});

4
src/globals.d.ts vendored
View file

@ -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[],
}