Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG]: Google Analytics never loads: `google-analytics` key in settings.yml doesn't match `google_analytics` used in templates

Aperta
#148 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@tarunagnihotri534 ci sta già lavorando.

Dal 10/10/2026.

  • #149 di @tarunagnihotri534 — aperta

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

  1. Build and serve the site (or open https://blog.dataumbrella.org).
  2. View page source on any page and search for G-LRFB0L7E0Z or googletagmanager.
  3. Open DevTools → Network and filter for gtag or collect.

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 build and check that _site/index.html contains the GA snippet with the correct ID.
  • After deploying, confirm requests to googletagmanager.com in 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di data-umbrella/data-umbrella.github.io

Tutte le issue di data-umbrella/data-umbrella.github.io

Issue simili

Altre issue su Data Visualization

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.