mitjans / nuxt-posthog

Posthog module for Nuxt
https://nuxt-posthog.cmitjans.dev
MIT License
27 stars 3 forks source link

No $pageleave events have been received #35

Closed toniengelhardt closed 2 months ago

toniengelhardt commented 3 months ago

I'm seeing this warning in the PostHog UI:

Screenshot 2024-07-19 at 14 21 07

According to the docs, the capture_pageleave setting should be turned on by default.

Screenshot 2024-07-19 at 14 27 18

Is there anything I have to configure to make this work?

mitjans commented 3 months ago

Have you tried manually activating this feature through PostHog options? In nuxt.config.ts:

export default defineNuxtConfig({
  posthog: {
    clientOptions: {
      capture_pageleave: true,
    },
  },
});

I was able to receive page leave events with this setting turned on. By default this module setsa page_view to false, and maybe this affects somehow to page_leave as well (although I haven't seen the documentation mentioning it)

toniengelhardt commented 3 months ago

Thanks, I'll try that 🙏🏽