cleanup
This commit is contained in:
parent
fde8f30fb5
commit
20eabe596a
3 changed files with 2 additions and 17 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
<script module>
|
<script module>
|
||||||
// GTM configuration
|
// GTM configuration
|
||||||
const GTM_ID = 'GTM-P9TTSWG2';
|
const GTM_ID = 'GTM-P9TTSWG2';
|
||||||
const GTM_SCRIPT=`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${GTM_ID}');`
|
const GTM_SCRIPT = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${GTM_ID}');`;
|
||||||
|
|
||||||
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';
|
||||||
|
|
@ -52,6 +52,7 @@
|
||||||
height="0"
|
height="0"
|
||||||
width="0"
|
width="0"
|
||||||
style="display:none;visibility:hidden"
|
style="display:none;visibility:hidden"
|
||||||
|
title=""
|
||||||
></iframe>
|
></iframe>
|
||||||
</noscript>
|
</noscript>
|
||||||
<!-- End Google Tag Manager (noscript) -->
|
<!-- End Google Tag Manager (noscript) -->
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
// Reuters Chartbeat UID
|
// Reuters Chartbeat UID
|
||||||
const UID = 52639;
|
const UID = 52639;
|
||||||
|
|
||||||
const attachScript = () => {
|
|
||||||
// If script is already attached, skip
|
|
||||||
// loaded via GTM Container
|
|
||||||
};
|
|
||||||
|
|
||||||
export default (authors: { name: string }[]) => {
|
export default (authors: { name: string }[]) => {
|
||||||
window._sf_async_config = {
|
window._sf_async_config = {
|
||||||
|
|
@ -17,12 +13,6 @@ export default (authors: { name: string }[]) => {
|
||||||
authors: authors.map((a) => a?.name || '').join(','),
|
authors: authors.map((a) => a?.name || '').join(','),
|
||||||
...(window._sf_async_config || {}),
|
...(window._sf_async_config || {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
|
||||||
attachScript();
|
|
||||||
} catch (e) {
|
|
||||||
console.warn(`Error initialising Chartbeat Analytics: ${e}`);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const registerPageview = () => {
|
export const registerPageview = () => {
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,10 @@
|
||||||
// Reuters Google Tag ID
|
// Reuters Google Tag ID
|
||||||
const GOOGLE_TAG_ID = 'G-WBSR7WLTGD';
|
const GOOGLE_TAG_ID = 'G-WBSR7WLTGD';
|
||||||
|
|
||||||
const attachScript = () => {
|
|
||||||
// If script is already attached, skip
|
|
||||||
// loaded via GTM Container
|
|
||||||
};
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
try {
|
try {
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
if (!window.gtag) {
|
if (!window.gtag) {
|
||||||
attachScript();
|
|
||||||
/** @type {Gtag.Gtag} */
|
/** @type {Gtag.Gtag} */
|
||||||
window.gtag = function () {
|
window.gtag = function () {
|
||||||
// eslint-disable-next-line prefer-rest-params
|
// eslint-disable-next-line prefer-rest-params
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue