Next.JS & Data API to create a page counter

Hey there everyone! :wave:

I’ve recently found the Data API and must say I’ve fallen in love with it, so much so I’ve decided to write my first tutorial I thought I’d share:
https://deloughry.co.uk/logs/using-mongodb-s-data-api-next-js-with-swr-to-make-a-page-click-tracker

I needed to be able to track page views on my website but didn’t want to have the hurdles and bloat that comes with installing a full-blown analytics package, plus I’m a nerd and wanted to build my own functionality.

I hope someone finds it useful and I’m sure that I’ll be creating more content in the near future too :smiley:

Thanks
Matt

2 Likes

Awesome Matt! Also love the style on your site

Thanks, yeah I’m in no way good at UI and UX so wanted to go with something that was easier for me to fumble along with :smiley: