# Roll Your Own Analytics With Astro, Vercel Edge Functions and Neon

DevFeed: [Roll Your Own Analytics With Astro, Vercel Edge Functions and Neon](<https://devfeed.tech/articles/roll-your-own-analytics-with-astro-vercel-edge-functions-and-neon-5777.md>)

Original publisher: [Read original article](<https://neon.com/blog/roll-your-own-analytics-with-astro-vercel-edge-functions-and-neon>)

Author: Paul Scanlon

Published: 2023-10-03T12:35:21Z

Content type: tutorial

Language: en

Sources: [Blog -- Neon Docs](<https://devfeed.tech/sources/blog-neon-docs.md>)

Topics: [Astro](<https://devfeed.tech/topics/astro.md>), [Vercel](<https://devfeed.tech/topics/vercel.md>), [Edge](<https://devfeed.tech/topics/edge.md>), [dashboards](<https://devfeed.tech/topics/dashboards.md>), [Serverless](<https://devfeed.tech/topics/serverless.md>), [API](<https://devfeed.tech/topics/api.md>), [Next.js](<https://devfeed.tech/topics/next-js.md>)

Tags: [analytics](<https://devfeed.tech/tags/analytics.md>), [api](<https://devfeed.tech/tags/api.md>), [astro](<https://devfeed.tech/tags/astro.md>), [community](<https://devfeed.tech/tags/community.md>), [database](<https://devfeed.tech/tags/database.md>), [edge](<https://devfeed.tech/tags/edge.md>), [next-js](<https://devfeed.tech/tags/next-js.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [vercel](<https://devfeed.tech/tags/vercel.md>)

## AI overview

A tutorial explaining how to build lightweight, self-hosted site analytics with Astro, Vercel Edge Functions, and a Neon serverless Postgres database. It captures page views and geolocation data for dashboard visualizations, including a 3D globe, as an alternative to relying on Google Analytics dimensions that are no longer available in GA4.

## Source excerpt

I've prepared a sample repository showing the implementation for a site built using Astro and deployed to Vercel. I've used this same approach for my own site, paulie.dev, and I'll explain how I've used the data to create the visualisations on my dashboard. For good measure, I've...