Repository
Current version released
2 years ago
Dependencies
deno.land/x
Versions
fresh_g_a
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.
Usage
Add to your import map
// in your import_map.json
{
"imports": {
"$fresh_g_a/": "https://deno.land/x/fresh_g_a@0.1.2/"
}
}
Setup your routes/_middleware.ts
import { gaMiddleware } from '$fresh_g_a/mod.ts'
export const handler = [
// other middlewares...
gaMiddleware
];
Set the GA_TRACKING_ID environment variable
Use the value provided by Google Analytics (G-XXXXXXXXXX). For more info refer to g_a’s documentation