-
Notifications
You must be signed in to change notification settings - Fork 139
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
feat: add opt_out_useragent_filter and $browser_type #949
feat: add opt_out_useragent_filter and $browser_type #949
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought for safety but otherwise this looks good to me
@pauldambra thank you for the quick review! I noticed that the https://github.com/PostHog/posthog-js/actions/runs/7422381529/job/20199038129?pr=949
|
Yeah, I think we have to accept that we can't run the testcafe tests on a fork. I guess there's no way not to risk leaking the secrets to a malicious fork. If this change was larger then I'd be tempted to duplicate it myself and run it locally but I think we'd be safe to merge this and then follow-up if a bug fix was needed |
6e51e70
to
8d8f4a8
Compare
Note that we also added the raw user agent as Ensured the name lines up with the User Agent Populator documentation |
Ah... we already send So, you shouldn't need to add the $useragent prop. If we can drop that then I think this PR is good to go. (sorry to be so picky... everything that ends up in the SDK is supported forever so I've learned to be careful here 😊) |
This reverts commit 8d8f4a8.
@pauldambra reverted the I did notice that none of our events have a |
Ah |
Description
We at Cambly would love to capture bot traffic through PostHog. Currently bot traffic is automatically filtered out and there is no way to disable the filter.
posthog-js/src/posthog-core.ts
Line 869 in 958fec4
Changes
opt_out_useragent_filter
config option to allow clients to opt out of user agent filtering (e.g. bots)$browser_type
to every capture event to be able to differentiate between bots and regular browsers. Based on User Agent PopulatorChecklist