How to use Google Analytics in Deno Deploy
Server-side Google Analytics on Deno Deploy sidesteps ad blockers, which Deno says over 70% of its audience uses, and gives more reliable tracking than the client-side snippet. The g_a module offers createReporter, which logs each request, response, timing and error from a std/http serve handler, and createReportMiddleware for oak apps. The tracking ID can be passed in code or set as the GA_TRACKING_ID environment variable in Deploy settings. The module supports only the now-retired Universal Analytics, with GA4 and event support under investigation.
Related posts
- How to get deep traces in your Node.js backend with OTel and Deno
Deno mediumAdeptRunning an unmodified Node.js Express server under Deno 2.2+ with the `--unstable-otel` flag yields OpenTelemetry traces and span-correlated logs with no code changes. Deno auto-instruments `console.log`, `fetch` and `Deno.serve()`. The comparison is a small ChatGPT-backed chat app viewed in Grafana's otel-lgtm Docker stack (Tempo for traces). The plain-Node route needed eight @opentelemetry dependencies, an 84-line telemetry.js configuring NodeSDK exporters and HTTP instrumentation, and a custom logger that attaches trace IDs. In Deno, a few environment variables are enough, though the feature is still experimental.
- Build a dinosaur runner game with Deno, pt. 6
Deno mediumAdeptThe final stage of the Deno dinosaur runner series adds observability using Deno Deploy's built-in logs, traces and metrics dashboards. A logging middleware emits one structured JSON line per HTTP request, and route handlers log business events like score submissions and customization saves. Custom OpenTelemetry spans wrap the leaderboard, score submission and customization routes, carrying attributes, events and recorded exceptions. Platform metrics (status codes, latency, CPU, memory, GC time, bandwidth) are used to spot anomalies before drilling into traces, and the `--tunnel` flag sends local telemetry to the same dashboards for verification before deploying.
- Run npm and Deno anywhere
Deno mediumAdeptDeno apps, including those using npm specifiers, can be containerized with the official denoland/deno Docker image and deployed to any VPS or container platform, not just Deno Deploy. A shared Oak-based main.ts, Dockerfile and docker-compose.yml are built locally, then pushed and run on AWS Lightsail via Docker Hub, on a Digital Ocean Droplet via its container registry and docker run, and on Google Cloud Run via Artifact Registry and gcloud run deploy. npm specifiers were not yet supported on Deno Deploy at the time.
- Deno 1.8 Release Notes
Deno mediumAdeptDeno 1.8 adds experimental WebGPU support (built on wgpu/gfx-rs) aimed at GPU-accelerated ML such as running TensorFlow.js, ships full ICU so all JS Intl APIs match browsers, and stabilizes import maps, which can now be loaded from URLs. Coverage is split into collection (`deno test --coverage=dir`) and reporting (`deno coverage`, with lcov output for codecov/coveralls). Private module fetching works via per-host bearer tokens in `DENO_AUTH_TOKENS`. Other changes include an exit sanitizer for `Deno.test`, stable runtime permission query/request/revoke APIs, stabilized link/symlink APIs, per-op `Deno.metrics`, JSON formatting in `deno fmt`, and IIFE bundles from `Deno.emit`.
- How to setup a blog with Hugo and Deno Deploy
Deno mediumAdeptA Hugo static site can be published on Deno Deploy by building it in GitHub Actions and serving the generated public directory with Deno's standard-library file server, imported directly by URL with no download or compile step. The walkthrough covers installing Hugo, adding the ananke theme as a git submodule, creating posts, linking a GitHub repo to a Deno Deploy project in GitHub Actions mode, and a complete workflow YAML using peaceiris/actions-hugo and denoland/deployctl. Any static site generator works the same way, since Deno Deploy only needs to serve the built HTML files.