DavidWells / analytics

Lightweight analytics abstraction layer for tracking page views, custom events, & identifying visitors
https://getanalytics.io
MIT License
2.43k stars 247 forks source link

Add Next.js with App router example #406

Closed dylanmeivis closed 11 months ago

dylanmeivis commented 11 months ago

While implementing analytics with a next.js project yesterday I tried searching for an example with the app router, but was not able to find one. Since router.events was replaced it now uses a new setup.

I made a small example on how I set it up myself using the provider and the hooks with the new next/router.

DavidWells commented 11 months ago

awesome work. Thanks for the example!