N
Nuxt8mo ago
awacode

Partytown with Vercel Analystics & Vercel Speed Insights

How to integrate vercel analytics & vercel speed insights ith partytown in nuxt? Could not find any example. Happy for help! best regards, Annick
4 Replies
awacode
awacodeOP8mo ago
as no one is answering maybe you @danielroe can give me a hint? Would be really appreciated
Muhammad Mahmoud
Partytown is used with external scripts only (Which you load by adding a script tag). Vercel analytics is an npm package and not an external script. A workaround (Haven't tried this before so not sure) would be uploading vercel analytics to some cdn and import that script with a script tag and add type='text/partytown'
danielroe
danielroe8mo ago
The main issue with partytown is CORS - so just make sure that whatever is serving your analytics script adds CORS headers
awacode
awacodeOP8mo ago
hey @Muhammad Mahmoud & @danielroe thanks for your answers. i understand. What about plausible?? i followed the instructions posted here on examples: https://nuxt.com/modules/partytown#plausible-analytics to use plausible with partytown in nuxt. But i do not understand how then i can execute a custom click event push from javascript. Before i was using https://nuxt.com/modules/plausible with the composable https://nuxt.com/modules/plausible#usetrackevent but how to manually track an event in javascript with the partytown/plausible integration? The instructions forwarded $plausible and $plausible.push. But how to access that within nuxt components to push events? I appreciate any advice!
Want results from more Discord servers?
Add your server