Skip to content

cdransf/next-goatcounter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-goatcounter

next-goatcounter is a plugin that makes integrating GoatCounter Analytics into you NextJS project easy.
Pull Requests are very welcome.

Feel like supporting this free plugin?

Buy Me A Coffee

Setup

First, install it:

npm install next-goatcounter

or

yarn add next-goatcounter

Now, in _app.js

import { GCScript } from "next-goatcounter";

and in return

    <GCScript siteUrl={"https://site.goatcounter.com/count"} />
    <Component {...pageProps} />

Note: GCScript supports scriptSrc parameter to specify self hosted count.js location

Usage

To send custom events to GoatCounter,

first

import { GCEvent } from "next-goatcounter";

then use GCEvent like this

GCEvent(path, title);

About

GoatCounter plugin for Next.js projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%