Skip to content

Send GA hits through the Google tag, keep the deploy going, and version asset URLs - #73

Merged
jsshin2022 merged 2 commits into
mainfrom
hub-deploy-safety
Oct 25, 2026
Merged

jsshin2022 merged 2 commits into
mainfrom
hub-deploy-safety

Conversation

@jsshin2022

@jsshin2022 jsshin2022 commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

What happened on 10/25

  1. Show the team's live activity, open on the track map, and call levels Level 0 to 4 #71 and Load the GA script from the hub stream's Google tag #72 merged at 12:46, and the deploy pushed gh-pages.
  2. A minute later, a bulk branch cleanup deleted gh-pages along with the merged branches.
  3. GitHub Pages lost its source branch, turned itself off, and the whole site returned 404.
  4. Re-running the deploy from the Actions tab (workflow_dispatch) then failed at the stats step: GitHub returned 403 for one of the stats calls, and the deploy stopped there.

The site is back: I re-ran the push deploy to recreate gh-pages and set Settings → Pages to gh-pages / root again.

This PR keeps the same thing from taking the site down again.

Changes

  • GA, second half of the Load the GA script from the hub stream's Google tag #72 fix: ga.js now configures the Google tag (G-BEBVKYH8HL), which is the snippet GA's install guide gives for the hub stream.
    • After Load the GA script from the hub stream's Google tag #72 the script loaded, but with only G-C5V0X2SGD3 configured gtag kept waiting on that ID's missing script and still sent nothing.
    • I checked on the live hub: with the tag configured, a test event (ga_check3), the page view and session_start appear in the hub property's realtime report. Before that, the deployed page sent nothing.
  • update_stats.py: a refused or failed GitHub call keeps last week's stats.json and exits normally, so the rest of the deploy still runs.
  • Asset versions:
    • Each deploy appends ?v=<commit> to every assets/js/*.js and assets/css/*.css URL in the published HTML. This covers the home page, article, game, lab, 404 and Builder pages.
    • Pages serves files with a ten-minute cache. Without the version, a browser can run the previous deploy's scripts against the new HTML for up to ten minutes. That happened today right after the merge: the new page loaded the old hub.js and ga.js.
  • CONTRIBUTING: a 배포 section says not to delete gh-pages.

Checked

  • I ran the versioning step on a local copy of the site. Every script and style URL gets ?v=, including the /assets/... paths on Builder pages.
  • The workflow YAML parses.

Generated by Claude Code

…t URLs

A refused stats call stopped the whole deploy. The stats script now keeps
last week's numbers when GitHub refuses or fails. Each deploy adds its
commit to script and style URLs, so browsers holding the previous files
for ten minutes do not run old scripts against new pages. CONTRIBUTING
notes that deleting gh-pages takes the site down.
Loading the script from the Google tag was not enough: with only the
measurement ID configured, gtag still waited on that ID's missing script
and sent nothing. Configuring the Google tag itself, as GA's install guide
for the stream does, delivers the page view and events to the hub
property; a test event from the live hub showed up in its realtime
report.
@jsshin2022 jsshin2022 changed the title Keep the deploy going when GitHub stats are refused, and version asset URLs Send GA hits through the Google tag, keep the deploy going, and version asset URLs Oct 25, 2026
@jsshin2022
jsshin2022 merged commit 13b5bd1 into main Oct 25, 2026
@jsshin2022
jsshin2022 deleted the hub-deploy-safety branch October 25, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant