Skip to content

Commit fa9a53b

Browse files
Merge pull request #20 from open-neuroscience-foundation/native-google-tag
inline-native-google-tag
2 parents 88291a6 + e381bc1 commit fa9a53b

6 files changed

Lines changed: 24 additions & 22 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["crates/cli", "crates/core", "crates/wasm/overlay"]
44

55
[workspace.package]
6-
version = "0.9.1"
6+
version = "0.9.2"
77
license = "Apache-2.0"
88
edition = "2021"
99
rust-version = "1.77"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Other differences
2828
- no docker
2929
- updated footer "Powered by" link
3030
- `CRUNCHBASE_CACHE_TTL` env var, and setting it to 0 causes not refreshing crunchbase
31+
- basic direct inlining of Google Tags, since CNCF approach does not work since 2024-05-01
3132

3233
## Notes
3334

ui/embed/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "embed",
33
"private": true,
4-
"version": "0.9.0",
4+
"version": "0.9.2",
55
"type": "module",
66
"scripts": {
77
"build": "tsc && vite build",

ui/webapp/index.html

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@
3333
<% } %>
3434
<title>{{ datasets.base.title }}</title>
3535
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
36+
37+
{% if let Some(analytics) = analytics %}
38+
{% if let Some(gtm) = analytics.gtm %}
39+
{% if let Some(tag) = gtm.container_id %}
40+
<!-- Google tag (gtag.js) -->
41+
<script async src="https://www.googletagmanager.com/gtag/js?id={{tag}}"></script>
42+
<script>
43+
window.dataLayer = window.dataLayer || [];
44+
function gtag(){dataLayer.push(arguments);}
45+
gtag('js', new Date());
46+
47+
gtag('config', '{{tag}}');
48+
</script>
49+
{% endif %}
50+
{% endif %}
51+
{% endif %}
52+
3653
<% if (isDev) { %>
3754
<script>
3855
fetch("./static/data/base.json")
@@ -49,24 +66,8 @@
4966
window.statsDS = {{ datasets.stats|json_compact|safe }};
5067
</script>
5168
<% } %>
52-
<% if (!isDev) { %>
53-
{% set gtm_container_id = analytics|get_gtm_container_id %}
54-
{% if let Some(gtm_container_id) = gtm_container_id %}
55-
<!-- Google Tag Manager -->
56-
<script defer data-container-id="{{ gtm_container_id }}" src="assets/gtm.js"></script>
57-
<!-- End Google Tag Manager -->
58-
{% endif %}
59-
<% } %>
6069
</head>
6170
<body>
62-
<% if (!isDev) { %>
63-
{% if let Some(gtm_container_id) = gtm_container_id %}
64-
<!-- Google Tag Manager (noscript) -->
65-
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ gtm_container_id }}"
66-
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
67-
<!-- End Google Tag Manager (noscript) -->
68-
{% endif %}
69-
<% } %>
7071
<div id="landscape"></div>
7172
<script type="module" src="/src/index.tsx"></script>
7273
</body>

ui/webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "landscape",
33
"private": true,
4-
"version": "0.9.0",
4+
"version": "0.9.2",
55
"type": "module",
66
"scripts": {
77
"build": "tsc && vite build",

0 commit comments

Comments
 (0)