[BUG]: Google Analytics never loads: `google-analytics` key in settings.yml doesn't match `google_analytics` used in templates
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- html, jekyll
- Ambito
- analytics
Direzione di ricerca
The mismatch is between the key in _data/settings.yml (line 123, google-analytics) and the lookups site.data.settings.google_analytics in _layouts/default.html (line 7) and _includes/google-analytics.html (lines 2 and 8). Check the work already in linked pull request #149 before starting. Done means the GA snippet appears in the built _site/index.html with the correct ID.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Google Analytics is not loaded on any page of the site. The tracking ID is defined in _data/settings.yml under a hyphenated key (google-analytics), but the templates look it up with an underscored key (google_analytics). Because the names don't match, the lookup returns nil and the GA snippet is never rendered.
Affected files
| File | Line(s) | What it uses |
|---|---|---|
_data/settings.yml |
123 | google-analytics: G-LRFB0L7E0Z (hyphen) |
_layouts/default.html |
7 | site.data.settings.google_analytics (underscore) |
_includes/google-analytics.html |
2, 8 | site.data.settings.google_analytics (underscore) |
Steps to reproduce
- Build and serve the site (or open https://blog.dataumbrella.org).
- View page source on any page and search for
G-LRFB0L7E0Zorgoogletagmanager. - Open DevTools → Network and filter for
gtagorcollect.
Expected behavior
The GA4 snippet is included in the <head> of every page, and the Network tab shows requests to googletagmanager.com.
Actual behavior
No GA snippet is present in the rendered HTML and no analytics requests are made on any page.
Root cause
Key naming mismatch between the YAML data file and the Liquid templates:
# _data/settings.yml (line 123)
google-analytics: G-LRFB0L7E0Z
{# _layouts/default.html (line 7) and _includes/google-analytics.html (lines 2, 8) #}
site.data.settings.google_analytics
The templates read google_analytics, which doesn't exist in the data file, so it evaluates to nil and the include is skipped.
Proposed fix
Rename the key in _data/settings.yml so it matches the templates:
- google-analytics: G-LRFB0L7E0Z
+ google_analytics: G-LRFB0L7E0Z
Underscored keys are also safer in Liquid dot notation than hyphenated ones.
How to verify the fix
- Run
bundle exec jekyll buildand check that_site/index.htmlcontains the GA snippet with the correct ID. - After deploying, confirm requests to
googletagmanager.comin the Network tab. - Check the GA4 Realtime report to confirm that visits are being recorded.
Impact
- Severity: High
- Scope: Every page on the site.
- Traffic and engagement data is not being collected, and past data can't be recovered. The failure is silent, so nothing in the build or the UI shows the problem.
- Lingua principale
- HTML
- Stelle
- 4
- Fork
- 14
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di data-umbrella/data-umbrella.github.io
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
data-umbrella/data-umbrella.github.io#144 · 1 reazione ·
-
Update byline with authorForse di nuovo libera @BerylKanali l’ha presa 537 giorni fa e non c’è nessuna pull request aperta. Aperta
data-umbrella/data-umbrella.github.io#136 · 1 assegnatario ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 35/100
data-umbrella/data-umbrella.github.io#127 · 14 commenti ·
-
Add in author byline infoForse di nuovo libera @SangamSwadiK l’ha presa 541 giorni fa e non c’è nessuna pull request aperta. Aperta
data-umbrella/data-umbrella.github.io#126 · 1 assegnatario ·
Tutte le issue di data-umbrella/data-umbrella.github.io
Issue simili
-
plot_components fails for logistic models with minmax scaling and no floorForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 4 giorni
-
curriculum documentation quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
githubnext/gh-aw-workshop#5035 ·
I maintainer di solito rispondono entro 1 giorno
-
bug P3 size: 1
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug: top-list widget shows compact values with 3 decimals (e.g. 8.862K)Forse già presa @mvanhorn l’ha presa oggi. Apertabug feat-dashboard
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
langfuse/langfuse#19410 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
data enhancement ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
userFRM/egui-charts#989 ·
I maintainer di solito rispondono entro 1 giorno