Skip to content

Commit

Permalink
feat: add ga4 plugin (#654)
Browse files Browse the repository at this point in the history
I didn't want to block you anymore, so I've created the PR as is.
Although I did just recently make a change to no longer hardcode the
fresh version in my plugin, and it no longer references ga4 main. (In
the unlikely event that anyone updates the project, we're now safe.)

I will try to finish the tests later this week, and then I think it's
time for a `0.1.0` release, since I suppose not a lot will change after
the tests are done.

---------

Co-authored-by: Asher Gomez <[email protected]>
  • Loading branch information
deer and iuioiua authored Jan 17, 2024
1 parent b8ef02a commit 2ad31f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ git rev-parse HEAD
[set up your Stripe branding](https://dashboard.stripe.com/settings/branding)
to customize the look and feel of your Stripe checkout page.

### Google Analytics (Optional)

Set `GA4_MEASUREMENT_ID` in your production environment to enable Google
Analytics.

> Note: it is not recommended to set this locally, otherwise your tests and
> debugging requests will be logged.
## REST API Reference

### `GET /api/items`
Expand Down
4 changes: 3 additions & 1 deletion fresh.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import errorHandling from "./plugins/error_handling.ts";
import securityHeaders from "./plugins/security_headers.ts";
import welcomePlugin from "./plugins/welcome.ts";
import type { FreshConfig } from "$fresh/server.ts";
import { ga4Plugin } from "https://deno.land/x/[email protected]/mod.ts";

export default {
plugins: [
ga4Plugin(),
welcomePlugin,
kvOAuthPlugin,
sessionPlugin,
tailwind(),
errorHandling,
securityHeaders,
],
} as FreshConfig;
} satisfies FreshConfig;

0 comments on commit 2ad31f9

Please sign in to comment.