vercel / analytics

Privacy-friendly, real-time traffic insights
https://vercel.com/analytics
Mozilla Public License 2.0
416 stars 24 forks source link

Error 400 when using analytics/server track in server actions #115

Closed mtsdalmolin closed 9 months ago

mtsdalmolin commented 9 months ago

Error 400 when using analytics/server track in server actions

I am getting http error 400 on analytics when using analytics/server track in server actions. Following the documentation, this is the code snippet I am running:

export async function getTeamStatistics(_: any, formData: FormData) {
  const teamId = formData.get('teamId')!
  const teamName = formData.get('teamName')!

  await track('action:getTeamStatistics', {
    teamId: teamId as unknown as string,
    teamName: teamName as unknown as string
  })
  ...
}

I haven't seen any custom event in my analytics page and the logs of the request is showing this: image

No custom events in analytics page: no-custom-events

Is there anything I am doing wrong?

P.S.: I made a stackblitz with a simplistic reproduction of the code I am running.

tobiaslins commented 9 months ago

Hey @mtsdalmolin !

sorry for the inconvenience. there were some issues for some deployments that are now fixed. can you please redeploy and try again? it should be working fine now! 🙂

mtsdalmolin commented 9 months ago

Yep, it's working now, @tobiaslins. Sorry for bothering you guys here in github with this issue, I thought it was something I was doing wrong.