fresh_g_a is a Fresh Framework middleware. Uses g_a (by denoteam) to collect server side Google Analytics events.
Forked from fresh_ga, a client side data collection plugin which adding the gtag to the html output.
// in your import_map.json
{
"imports": {
"$fresh_g_a/": "https://deno.land/x/[email protected]/"
}
}
import { gaMiddleware } from '$fresh_g_a/mod.ts'
export const handler = [
// other middlewares...
gaMiddleware
];
Use the value provided by Google Analytics (G-XXXXXXXXXX). For more info refer to g_a's documentation