Skip to content

Commit

Permalink
Set ga4 tag dynamically
Browse files Browse the repository at this point in the history
Update URL to sb_logo.png

Update options to exclude showing /annex
  • Loading branch information
nathanweeks committed Jan 1, 2025
1 parent 1ac4b15 commit 6ed0e6a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/_h5ai/private/conf/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"fastBrowsing": true,
"fonts": ["Ubuntu", "Roboto", "Helvetica", "Arial", "sans-serif"],
"fontsMono": ["Ubuntu Mono", "Monaco", "Lucida Sans Typewriter", "monospace"],
"hidden": ["^\\.", "^_h5ai", "^data$", "^private", "^public", ".fai$", ".gzi$", ".tbi$"],
"hidden": ["^\\.", "^_h5ai", "^annex", "^data$", "^private", "^public", ".fai$", ".gzi$", ".tbi$"],
"hideFolders": false,
"hideIf403": true,
"hideParentFolder": false,
Expand Down Expand Up @@ -173,8 +173,8 @@
- id: string, account ID
*/
"google-analytics-ua": {
"enabled": true,
"id": "UA-49655154-3"
"enabled": false,
"id": "UA-00000000-0"
},

/*
Expand Down
15 changes: 15 additions & 0 deletions src/_h5ai/private/php/pages/page.tpl.pug
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ html(class='no-js', lang='en')
link(rel='shortcut icon', href!='<?= $public_href; ?>images/favicon/favicon-16-32.ico')
link(rel='apple-touch-icon-precomposed', type='image/png', href!='<?= $public_href; ?>images/favicon/favicon-152.png')
link(rel='stylesheet', href!='<?= $public_href; ?>css/styles.css')
<?php if (strpos($_SERVER['HTTP_HOST'], 'soybase.org') !== false) { ?>
script(async src='https://www.googletagmanager.com/gtag/js?id=G-8KSLD77VLS')
script.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-8KSLD77VLS');
<?php } elseif (strpos($_SERVER['HTTP_HOST'], 'data.legumeinfo.org') !== false) { ?>
script(async src='https://www.googletagmanager.com/gtag/js?id=G-PJLDBJV1KB')
script.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-PJLDBJV1KB');
<?php } ?>
<?php if (!$fallback_mode) { ?>
script(src!='<?= $public_href; ?>js/scripts.js', data-module=module)
<?php } ?>
Expand Down
2 changes: 1 addition & 1 deletion src/_h5ai/public/js/lib/view/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let location = window.location.hostname.includes('soybase.org');
const TPL_TOPBAR =
location ? `<div id="topbar">
<a href="javascript: window.location = \`https://www.soybase.org/\` ">
<img src="https://dev.soybase.org/assets/img/sb_logo.png" height=51 width=50 alt="Soybase logo">
<img src="https://www.soybase.org/assets/img/sb_logo.png" height=51 width=50 alt="Soybase logo">
</a>
<div id="toolbar"></div>
<div id="flowbar"></div>
Expand Down

0 comments on commit 6ed0e6a

Please sign in to comment.