Debug and Test Mode
Use debug mode while you build and check an integration. Ads still serve, so you see real creatives in your layout, but nothing you do is recorded or billed.
Turning it on
Add surf_debug=true to the URL of the page you are testing. No code change is needed:
https://shop.example.com/menu?surf_debug=true
The SDK reads the page URL and puts every ad request from that page in debug mode. This works in every workflow:
| Workflow | Where the page URL comes from |
|---|---|
| Web Components | The browser address bar |
| React Components and React Hooks | The browser address bar |
| Headless | The url you pass at initialization. Add the parameter to that URL (see Request context) |
The parameter lasts only for that page load. Load the page without it, and requests are production traffic again.
What debug mode does
- Ads still serve, so they render as they would in production.
- No bid, impression, click or spend is recorded, and no frequency cap or budget is charged.
- Ads serve on development hosts, such as
localhostor a staging domain, that would otherwise be blocked. - With Web Components, the SDK also logs to the browser console: the configuration it loaded, the full ad request, and why a placement served nothing. With React or Headless, turn on the
loggingoption for console output (see Initialization).
Anyone who adds the parameter to a live page URL gets debug mode for that visit. That is safe: it only stops their own visit from being recorded. Never add it to the links or pages your shoppers use, or their ads will not be counted.
iOS apps
The iOS Ads SDK (SurfsideAdsKit 1.2.0 or later) has its own switches, so you do not edit any URL:
isInspectable: trueonSurfsideAds.Configurationturns on debug mode, with logging to the Xcode console.developmentTesting: truegives the same no-recording behaviour without the logging.
Set them in development builds only. See Native iOS and the SurfsideAdsKit README section Verifying your integration.