Merge pull request #323 from reuters-graphics/rm-parsely
AB# DONE: Remove Parse.ly integration from Graphics pages
This commit is contained in:
commit
3ae55fab6f
5 changed files with 6 additions and 45 deletions
5
.changeset/angry-words-fall.md
Normal file
5
.changeset/angry-words-fall.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@reuters-graphics/graphics-components': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Removes Parsely page analytics
|
||||||
|
|
@ -3,13 +3,11 @@
|
||||||
<script module>
|
<script module>
|
||||||
import { registerPageview as registerChartbeatPageview } from './providers/chartbeat';
|
import { registerPageview as registerChartbeatPageview } from './providers/chartbeat';
|
||||||
import { registerPageview as registerGAPageview } from './providers/ga';
|
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. */
|
/** Register virtual pageviews when using client-side routing in multipage applications. */
|
||||||
function registerPageview() {
|
function registerPageview() {
|
||||||
registerChartbeatPageview();
|
registerChartbeatPageview();
|
||||||
registerGAPageview();
|
registerGAPageview();
|
||||||
registerParselyPageview();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export { registerPageview };
|
export { registerPageview };
|
||||||
|
|
@ -21,7 +19,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { ga, chartbeat, parsely } from './providers';
|
import { ga, chartbeat } from './providers';
|
||||||
interface Props {
|
interface Props {
|
||||||
/**
|
/**
|
||||||
* Used to associate a page with its author(s) in Chartbeat.
|
* Used to associate a page with its author(s) in Chartbeat.
|
||||||
|
|
@ -34,6 +32,5 @@
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
ga();
|
ga();
|
||||||
chartbeat(authors);
|
chartbeat(authors);
|
||||||
parsely();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
export { default as ga } from './ga';
|
export { default as ga } from './ga';
|
||||||
export { default as chartbeat } from './chartbeat';
|
export { default as chartbeat } from './chartbeat';
|
||||||
export { default as parsely } from './parsely';
|
|
||||||
|
|
|
||||||
|
|
@ -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
8
src/globals.d.ts
vendored
|
|
@ -21,14 +21,6 @@ declare global {
|
||||||
};
|
};
|
||||||
/** Graphics ads */
|
/** Graphics ads */
|
||||||
graphicsAdQueue: any[];
|
graphicsAdQueue: any[];
|
||||||
/** Parsely */
|
|
||||||
PARSELY: {
|
|
||||||
onLoad: () => void;
|
|
||||||
beacon: {
|
|
||||||
trackPageView: () => void;
|
|
||||||
};
|
|
||||||
updateDefaults: (params: any) => void;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue