Transmission #058: Blog head ad replaces AdSense

Swapped the Hugo blog’s Google AdSense loader for a single third-party script in layouts/_partials/head.html, driven by [params.blog_head_ad] script_src in hugo.toml (same “one config knob” idea as before, without the AdSense-specific client string). Production keeps the script URL in TOML; builds omit the tag if script_src is unset.

If the reverse proxy uses a Content-Security-Policy, update script-src (and any connect-src the network needs) for the new host—AdSense domains are no longer required.

Head ad script timing (defer)

The tag stayed in head.html, but the loader now uses defer. A synchronous script at the end of <head> runs before the parser has opened <body>, so document.body is still null—many third-party injectors no-op or misbehave in that window. Deferred execution runs after the document is parsed, which matches how async AdSense behaved in practice.

Visibility: even with correct wiring, CPM networks often show nothing on a given page load (no fill, geo, format is pop/tab rather than a box, or fraud heuristics). DevTools Network (subrequests to domains the bundle references) and Elements (late-added iframes at the end of <body>) are the practical checks—not “do I see a banner every time.”