Skip to content

opt_out_capturing_by_default and cookieless_mode #2841

@gabriele-v

Description

@gabriele-v

Bug description

Hello,
I think that there is something wrong with opt_out_capturing_by_default and cookieless_mode

How to reproduce

Configure posthog init as below:
posthog.init("xxx", { api_host: 'xxx', ui_host: 'https://eu.posthog.com', cookieless_mode: "on_reject", opt_out_capturing_by_default: true, capture_exceptions: true, debug: true })

posthog-js is not sending any event until posthog.opt_out_capturing(); is called

Is it the expected behaviour? I'd expect that it immediately sends data in cookieless mode, because basically opt_out_capturing_by_default should behave like posthog.opt_out_capturing(); but immediately since first call.

Related sub-libraries

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-react-native
  • @posthog/react
  • @posthog/ai
  • @posthog/nextjs-config
  • @posthog/nuxt
  • @posthog/rollup-plugin
  • @posthog/webpack-plugin

Additional context

Thank you for your bug report – we love squashing them!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions