Skip to content

feat(debug): Make data reliable when debuging - #316

Open
jrosendahl-opt wants to merge 1 commit into
masterfrom
feat/debug-flag-overrides
Open

feat(debug): Make data reliable when debuging#316
jrosendahl-opt wants to merge 1 commit into
masterfrom
feat/debug-flag-overrides

Conversation

@jrosendahl-opt

@jrosendahl-opt jrosendahl-opt commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When you are debuging a page the sampling and a/b infrastructure get in the way. This change makes it so when you are in debug mode you are also in the production group and there is no analytics sampling.

  • Analytics sampling: shouldSample() now returns true immediately when optableDebug is set, regardless of the configured samplingRate
  • AB test group: optableDebug forces the production/treatment group, same as optableControlGroup=0 — explicit optableControlGroup=1 still takes priority
  • Bot detection: SkipTargetingForBots() returns false immediately when optableDebug is set, so targeting always runs even in bot-like environments (e.g. headless browsers during development)

Activated via ?optableDebug URL param or sessionStorage.setItem("optableDebug", "1") in the browser console, using the existing flags system.

Test plan

  • optableDebug in sessionStorage causes shouldSample() to return true even with samplingRate: 0
  • optableDebug forces production group assignment even when random bucket would land in control
  • optableControlGroup=1 overrides optableDebug (explicit control override still works)
  • SkipTargetingForBots() returns false when optableDebug is set
  • All existing tests pass (npx jest)

🤖 Generated with Claude Code

…nd bypasses bot detection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jrosendahl-opt
jrosendahl-opt requested review from a team as code owners August 14, 2026 15:29
@jrosendahl-opt
jrosendahl-opt requested a review from Yoshiji August 14, 2026 15:29
@jrosendahl-opt jrosendahl-opt changed the title feat(debug): optableDebug flag forces sampling=1, production group, and bypasses bot detection feat(debug): Make data reliable when debuging Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant