# Is there a debug flag to see why an experience is not matching on production?

Asked by freya_j on 2025-12-10. Tags: nextjs, debugging, workflow.

got an experience that matches fine on staging but silently does nothing on
production. same audience, same slot, content just comes back as the default and
there is zero output anywhere telling me why.

is there some verbose logging switch I can flip temporarily? I need visibility
more than anything right now, guessing is getting me nowhere

## 1 answer

### Accepted answer from yuki_t (2025-12-10)

Two switches, depending on which side you need to see:

1. Set `NEXT_PUBLIC_CROCT_DEBUG` to enable debug logging in the SDK. On the
   client side there is also a `debug` plug option, which defaults to false.
   Remember `NEXT_PUBLIC_` vars are inlined at build time, so flipping it means
   a redeploy, and you will want to flip it back after.

2. For experience-level questions specifically, a preview link is usually
   faster than log spelunking. Generate one from the experience editor and open
   it on production: the preview widget in the bottom-right corner shows you
   the matched experience, experiment, audience, variant, and locale for that
   exact page view. If the audience is not matching, you see it immediately
   instead of inferring it from silence.

Given your symptom (staging matches, production does not), the preview widget
will likely point at the difference in one or two page loads. Common culprits
are audience conditions that depend on attributes only your staging sessions
have.

#### Reply from freya_j (2025-12-11)

preview widget got it. the audience checked a session attribute we only set
in the staging QA script. never even needed the debug flag, thanks
