Skip to main content
Module

x/g_a/mod.ts>createReportMiddleware

Utilities for server side processing of Google Analytics in Deno CLI and Deploy
Latest
function createReportMiddleware
import { createReportMiddleware } from "https://deno.land/x/g_a@0.1.2/mod.ts";

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.

Examples

import { createReportMiddleware } from "https://deno.land/x/g_a/mod.ts";
import { Application } from "https://deno.land/x/oak/mod.ts";

const ga = createReportMiddleware();
const app = new Application();

app.use(ga);
// register additional middleware...

app.listen({ port: 0 });

Parameters

optional
options: ReportMiddlewareOptions = [UNSUPPORTED]

an optional set of options which affects the behavior of the returned middleware.

Returns

middleware which should be registered early in the stack with the application.