Skip to content

Commit 1c435dc

Browse files
fix(analytics): gate GA4 (G-7Q43R82K6D) firing to braindecode hostnames
Published docs 0.8-1.4 hardcoded a hostname-agnostic gtag.js snippet for braindecode's own GA4 id. Any third party that mirrors or vendors those built pages fired pageviews into braindecode's property under a foreign hostname - the source of the anomalous China / Unassigned-session traffic. Wrap both the gtag.js loader and the gtag('config') call in a hostname guard so analytics fires only on braindecode.org / braindecode.github.io; mirrors stay silent. braindecode.org's own analytics is preserved, and the GTM-NWDKLVNR container plus consent-mode blocks are untouched.
1 parent b926c6a commit 1c435dc

1,493 files changed

Lines changed: 3141 additions & 3141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

0.8/api.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="_static/doctools.js?v=888ff710"></script>
4545
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'api';</script>
6161
<script>

0.8/auto_examples/advanced_training/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/advanced_training/index';</script>
6161
<script>

0.8/auto_examples/advanced_training/plot_bcic_iv_4_ecog_cropped.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/advanced_training/plot_bcic_iv_4_ecog_cropped';</script>
6161
<script>

0.8/auto_examples/advanced_training/plot_data_augmentation.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/advanced_training/plot_data_augmentation';</script>
6161
<script>

0.8/auto_examples/advanced_training/plot_data_augmentation_search.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/advanced_training/plot_data_augmentation_search';</script>
6161
<script>

0.8/auto_examples/advanced_training/plot_relative_positioning.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/advanced_training/plot_relative_positioning';</script>
6161
<script>

0.8/auto_examples/advanced_training/sg_execution_times.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/advanced_training/sg_execution_times';</script>
6161
<script>

0.8/auto_examples/applied_examples/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/applied_examples/index';</script>
6161
<script>

0.8/auto_examples/applied_examples/plot_bcic_iv_4_ecog_trial.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/applied_examples/plot_bcic_iv_4_ecog_trial';</script>
6161
<script>

0.8/auto_examples/applied_examples/plot_sleep_staging_chambon2018.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
<script src="../../_static/doctools.js?v=888ff710"></script>
4545
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
4646
<script src="../../_static/design-tabs.js?v=36754332"></script>
47-
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D"></script>
47+
<script>if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname)){var s=document.createElement('script');s.async=true;s.src='https://www.googletagmanager.com/gtag/js?id=G-7Q43R82K6D';document.head.appendChild(s);}</script>
4848
<script>
4949
window.dataLayer = window.dataLayer || [];
5050
function gtag(){ dataLayer.push(arguments); }
5151
gtag('js', new Date());
52-
gtag('config', 'G-7Q43R82K6D');
52+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5353
</script>
5454
<script>
5555
window.dataLayer = window.dataLayer || [];
5656
function gtag(){ dataLayer.push(arguments); }
5757
gtag('js', new Date());
58-
gtag('config', 'G-7Q43R82K6D');
58+
if(/(^|\.)braindecode\.(org|github\.io)$/.test(location.hostname))gtag('config', 'G-7Q43R82K6D');
5959
</script>
6060
<script>DOCUMENTATION_OPTIONS.pagename = 'auto_examples/applied_examples/plot_sleep_staging_chambon2018';</script>
6161
<script>

0 commit comments

Comments
 (0)