This commit is contained in:
hobbes7878 2025-09-16 08:37:06 +01:00
parent fde8f30fb5
commit 20eabe596a
Failed to extract signature
3 changed files with 2 additions and 17 deletions

View file

@ -3,7 +3,7 @@
<script module>
// GTM configuration
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 registerGAPageview } from './providers/ga';
@ -52,6 +52,7 @@
height="0"
width="0"
style="display:none;visibility:hidden"
title=""
></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->

View file

@ -1,10 +1,6 @@
// Reuters Chartbeat UID
const UID = 52639;
const attachScript = () => {
// If script is already attached, skip
// loaded via GTM Container
};
export default (authors: { name: string }[]) => {
window._sf_async_config = {
@ -17,12 +13,6 @@ export default (authors: { name: string }[]) => {
authors: authors.map((a) => a?.name || '').join(','),
...(window._sf_async_config || {}),
};
try {
attachScript();
} catch (e) {
console.warn(`Error initialising Chartbeat Analytics: ${e}`);
}
};
export const registerPageview = () => {

View file

@ -1,16 +1,10 @@
// Reuters Google Tag ID
const GOOGLE_TAG_ID = 'G-WBSR7WLTGD';
const attachScript = () => {
// If script is already attached, skip
// loaded via GTM Container
};
export default () => {
try {
window.dataLayer = window.dataLayer || [];
if (!window.gtag) {
attachScript();
/** @type {Gtag.Gtag} */
window.gtag = function () {
// eslint-disable-next-line prefer-rest-params