Creates and returns a reporting measurement middleware for oak, which will
generate and send to Google Analytics measurements for each request handled
by an oak application.
Utilities for server side processing of Google Analytics in Deno CLI and Deploy.
When you server side render pages, it can be more efficient to not add Google
Analytics to the client side app, and instead send the messages directly via
your edge worker. This library provides a framework for doing this.
Usage
The library is designed to generate a measure message for each request and
response handled by a Deno CLI or Deno Deploy server. These messages are then
queued up and asynchronously batched to Google Analytics.
createReporter()
If you are using the Deno HTTP APIs directly, std/http, or various other HTTP
frameworks, createReporter() will return a function which can be used to
dispatch messages to Google Analytics.
You need to create the reporter function, and then call the reporter with
information about the current request and response.