Google Analytics

← All plugins

Google Analytics v2.0.0

Adds the Google Analytics (gtag.js) snippet to every page once you set your measurement ID.

Version
2.0.0 (released 2026-09-22)
Author
Jason Ernst
License
Apache-2.0
Source
https://github.com/goblogplatform/goblog-plugin-analytics
Requires
goblog 0.2.9 or newer (wasm plugin)
Runtime
wasm
Talks to
No network access
Download
https://github.com/goblogplatform/goblog-plugin-analytics/releases/download/v2.0.0/plugin.wasm
sha256 35a083f395070e7f9f97e5385597e068291ccc38d7878837ead3847d7958acd8

README

goblog-plugin-analytics

A goblog WebAssembly plugin that adds the Google Analytics (gtag.js) snippet to the <head> of every page.

Install

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).

Settings

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.

Build it yourself

GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -ldflags="-s -w" -o plugin.wasm .
go test ./...   # native tests for the rendering

Needs Go 1.25 or newer. Implements the identity, settings and template_head exports; see goblog.live/docs/plugin-api.

License

Apache-2.0.

Changelog

Changelog

2.0.0

  • Rewritten as a WebAssembly plugin, installable from the directory. Replaces the analytics plugin that was compiled into goblog up to 0.6.x; the settings keys are unchanged, so an upgraded site keeps its measurement ID.

1.0.0

  • Compiled-in goblog plugin: injects the gtag.js snippet into <head> when enabled is true and tracking_id is set.

Releases

v2.0.0 2026-09-22

Rewritten as a WebAssembly plugin, installable from the directory. Replaces the analytics plugin compiled into goblog up to 0.6.x; setting keys are unchanged so an upgraded site keeps its measurement ID.

GoBlog

Powered by goblog v0.16.0