Skip to content

simlevesque/fresh_g_a

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

fresh_g_a is a Fresh Framework middleware. Uses g_a (by denoteam) to collect server side Google Analytics events.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published