Skip to main content
Module

x/g_a/mod.ts>ReportMiddlewareOptions

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

Options which can be supplied to the createReporterMiddleware() factory function.

Properties

optional
endpoint: string

The batch Google Analytics endpoint to send messages to. This defaults to https://www.google-analytics.com/batch.

optional
id: string

The Google Analytics web property ID. This defaults to being read from the GA_TRACKING_ID environment variable. If neither the property ID is passed nor is the environment variable set, dispatching will be disabled.

optional
warn: boolean

A boolean which defaults to true that indicates if the library should log warning messages or not.

Methods

optional
filter(ctx: Context): boolean

An optional callback which determines if a particular request should generate a measurement message.

optional
log(msg: string): void

An optional function/method for logging warning messages generated from the library. This defaults to logging to console.warn().

optional
metaData(ctx: Context): MetaData | undefined

An optional callback which provides optional data to enrich the measurement message.