analytics icon indicating copy to clipboard operation
analytics copied to clipboard

Feature request: REST API

Open sanderpick opened this issue 1 year ago • 5 comments

I know this just launched on Vercel, but I'm curious if there will be an API to query page views and events... ideally w/ SQL? Let me know if there's a better place to ask this too.

sanderpick avatar Apr 20 '23 22:04 sanderpick

Yes, an API is on our roadmap. We will keep you updated. 🙌

timolins avatar May 02 '23 11:05 timolins

Hi @timolins - Will this also apply to the Speed Insights data? I would love to use this data for a cusotm reporting dashboard!

mt-hagen avatar Jun 07 '23 08:06 mt-hagen

I was also looking for this, as it would be a great tool to use for example in generateStaticParams with Next.js.

Instead of pre-generating all or none of the dynamic pages, one could instead use this to for example generate the top N visited pages.

Would be awesome if @vercel/analytics exported some simple utility functions for this!

// Imagined usage in `./src/app/products/[id]/[slug]/page.tsx`

export async function generateStaticParams() {
  return getStaticParamsMatching('/products/[id]/[slug]', { limit: 50 })
}

Svish avatar Jun 25 '23 19:06 Svish

Pinging this again to see where this is on the roadmap. Would pay to be able to query analytics through this npm library with a queryAnalytics({ queryParams... }).

masnwilliams avatar Oct 23 '23 04:10 masnwilliams

Really hoping this happens sometime in 2023 so I can use the analytics coming out of Vercel in a BI tool. Especially now that GA has become pretty useless with some recent law changes in Canada.

camcamcamcam avatar Oct 30 '23 14:10 camcamcamcam