A goblog WebAssembly plugin that adds the Google Analytics (gtag.js) snippet to the <head> of every page.
From your goblog's Admin → Plugins → Browse, search for Google Analytics and click Install. Or download plugin.wasm from the latest release into plugins/wasm/ as analytics.wasm and restart goblog.
Upgrading from goblog ≤ 0.6.x, where this plugin was compiled in: install it from the directory and your existing measurement ID and enabled flag carry over (same plugin name, same setting keys).
Under Admin → Settings → Google Analytics:
| Setting | Default | Meaning |
|---|---|---|
tracking_id |
Your measurement ID, e.g. G-XXXXXXXXXX. Only letters, digits and - are accepted; anything else disables the snippet. |
|
enabled |
false |
Set to true to emit the snippet |
The snippet is only added when both are set. The plugin itself makes no network requests (allowed_hosts is empty) — the visitor's browser loads gtag.js.
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -ldflags="-s -w" -o plugin.wasm .
go test ./... # native tests for the renderingNeeds Go 1.25 or newer. Implements the identity, settings and template_head exports; see goblog.live/docs/plugin-api.
Apache-2.0.