Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to programmatically disable #978

Open
imjared opened this issue Jul 30, 2024 · 1 comment
Open

Ability to programmatically disable #978

imjared opened this issue Jul 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@imjared
Copy link

imjared commented Jul 30, 2024

In #757, the user wanted to disable Segment in order to respect user preferences. In my use case, we get information about the user at run time that determines if we should or shouldn't track them.

Because the client gets initialized at app load, before user data is fetched, we aren't able to disable immediately. I'd love to be able to do something like:

const segment = useAnalytics();
if (user.type === "non_trackable") {
  segment.settings.set({ debug: true/false });
}

A similar behavior seems to exist in Analytics.js (link) so this doesn't seem out of the question. I know it's been flagged as a wontfix but the feature parity would be nice.

@imjared imjared added the enhancement New feature or request label Jul 30, 2024
@pTinosq
Copy link

pTinosq commented Aug 16, 2024

BUMP. Currently having our logs flooded by
Flush triggered but queue restoration and settings loading not complete. Flush will be retried.

Would be great to have a simple "enabled: true"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants