nuxt scripts rybbit.io analytics custom events hit or miss.
anyone using the nuxt scripts module with rybbit? I'm self hosting rybbit and the standard page events etc work perfectly but custom events i have setup are hit or miss. on a hard refresh they won't work until i navigate to another page and back, and some still don't work.
nuxt config
// Nuxt scripts module
scripts: {
registry: {
// Website analytics Rybbit.io
rybbitAnalytics: {
scriptInput: {
src: 'https://tracking.mywebsite.com/api/script.js',
},
siteId: '1',
},
},
},
and then on different pages where i want custom events i do
const { proxy } = useScriptRybbitAnalytics()
// Track event in analytics proxy.rybbit.event('profile_initial_setup_complete')
// Track event in analytics proxy.rybbit.event('profile_initial_setup_complete')
mywebsite.com - This website is for sale! - mywebsite Resources...
This website is for sale! mywebsite.com is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, mywebsite.com has it all. We hope you find what you are searching for!
5 Replies
Hi @WiFi Plug. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but the knowledge sources do not contain specific information about using the Nuxt Scripts module with Rybbit.io analytics, nor do they address issues with custom event tracking reliability (such as events only firing after navigation or not firing on hard refresh). The sources do confirm that Nuxt Scripts supports loading third-party analytics scripts and that there is a helper like useScriptRybbitAnalytics exported for Rybbit Analytics integration, but they do not provide troubleshooting steps or known issues for custom event handling with Rybbit.io specifically. The changelog only mentions the export of useScriptRybbitAnalytics, not its runtime behavior or event reliability issues Nuxt v3.17.5 changelog.
If you are experiencing inconsistent custom event tracking, it may be related to how and when the analytics script is loaded and initialized, but the knowledge sources do not provide enough detail to confirm this or suggest a solution. For more targeted help, you may want to check the official Nuxt Scripts documentation or open an issue in the Nuxt Scripts repository.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai but is my usage correct to set it up in nuxt config then in each page i want to send custom events i use const { proxy } = useScriptRybbitAnalytics() and then proxy.rybbit.event('my_event')?
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the available knowledge sources, your general approach aligns with how Nuxt Scripts is intended to be used: you configure the script in the nuxt.config file under the scripts registry, and then use the corresponding composable (such as useScriptRybbitAnalytics) in your pages to interact with the analytics script Nuxt v3.17.5 changelog.
However, the knowledge sources do not provide explicit documentation or code examples for the useScriptRybbitAnalytics composable or the exact usage of proxy.rybbit.event for sending custom events. The sources confirm the existence and export of useScriptRybbitAnalytics, but do not detail its API or guarantee that your usage pattern is correct for custom event tracking.
In summary:
- Setting up the script in nuxt.config as you have is correct according to the available information. - Using useScriptRybbitAnalytics in your pages is consistent with the intended usage. - The specific usage of proxy.rybbit.event('my_event') is not documented in the provided sources, so I cannot confirm with certainty that this is the correct or recommended way to send custom events. If you need confirmation or troubleshooting for custom event tracking, I recommend consulting the official Nuxt Scripts documentation or reaching out to the maintainers for more detailed guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
- Setting up the script in nuxt.config as you have is correct according to the available information. - Using useScriptRybbitAnalytics in your pages is consistent with the intended usage. - The specific usage of proxy.rybbit.event('my_event') is not documented in the provided sources, so I cannot confirm with certainty that this is the correct or recommended way to send custom events. If you need confirmation or troubleshooting for custom event tracking, I recommend consulting the official Nuxt Scripts documentation or reaching out to the maintainers for more detailed guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@679734274840330384> Kapa.ai is still learning and improving, please let me know how I did by reacting below.