rm parsely

This commit is contained in:
Kuyoshbek Mekhmonov 2025-06-25 11:28:29 -04:00
parent 77dbc4c4f3
commit 09a4d59150
Failed to extract signature
4 changed files with 1 additions and 45 deletions

View file

@ -3,13 +3,11 @@
<script module>
import { registerPageview as registerChartbeatPageview } from './providers/chartbeat';
import { registerPageview as registerGAPageview } from './providers/ga';
import { registerPageview as registerParselyPageview } from './providers/parsely';
/** Register virtual pageviews when using client-side routing in multipage applications. */
function registerPageview() {
registerChartbeatPageview();
registerGAPageview();
registerParselyPageview();
}
export { registerPageview };
@ -21,7 +19,7 @@
}
import { onMount } from 'svelte';
import { ga, chartbeat, parsely } from './providers';
import { ga, chartbeat } from './providers';
interface Props {
/**
* Used to associate a page with its author(s) in Chartbeat.
@ -34,6 +32,5 @@
onMount(() => {
ga();
chartbeat(authors);
parsely();
});
</script>

View file

@ -1,3 +1,2 @@
export { default as ga } from './ga';
export { default as chartbeat } from './chartbeat';
export { default as parsely } from './parsely';

View file

@ -1,32 +0,0 @@
const SITE_ID = 'reuters.com';
const attachScript = () => {
const b = document.body;
const e = document.createElement('script');
e.id = 'parsely-cfg';
e.src = `//cdn.parsely.com/keys/${SITE_ID}/p.js`;
e.setAttribute('async', '');
e.setAttribute('defer', '');
b.appendChild(e);
};
export default () => {
window.PARSELY = window.PARSELY || {
autotrack: false,
onReady() {
window.PARSELY.updateDefaults({
data: {
is_logged_in: false,
},
});
window.PARSELY.beacon.trackPageView();
},
};
attachScript();
};
export const registerPageview = () => {
if (typeof window === 'undefined' || !window.PARSELY) return;
window.PARSELY.beacon.trackPageView();
};

8
src/globals.d.ts vendored
View file

@ -21,14 +21,6 @@ declare global {
};
/** Graphics ads */
graphicsAdQueue: any[];
/** Parsely */
PARSELY: {
onLoad: () => void;
beacon: {
trackPageView: () => void;
};
updateDefaults: (params: any) => void;
};
}
}