Troubleshooting
Find out why the SDK does not load, a survey does not show or a hook does not run, and fix the cause in your code.
This page covers the causes that live in your code: the SDK does not start, the user is not identified, a hook blocks the display. Many surveys and messages do not show for a reason set in Screeb itself: the channel is not live, a targeting rule does not match, capping applies or the user has already answered. For those, follow My survey or message is not displayed in the help center.
Debug the SDK and its targeting
Section titled “Debug the SDK and its targeting”Two calls print what the SDK knows: the state of the current session, then the status of each targeting rule of each active survey.
Screeb.debug()Screeb.debugTargeting()On a website, the output goes to the browser console. In a mobile app, it goes to the native logs: the Xcode console on iOS, Logcat at the info level on Android.
Read the session state
Section titled “Read the session state”The session debug looks like this:
******************* SCREEB SESSION DEBUG *********************Screeb channel id: <UUID>Screeb channel type: widgetScreeb respondent id: <UUID>Screeb survey id: noneScreeb response id: none
Screeb current session start: Thu May 04 2023 16:53:49 GMT+0200Screeb current session last activity: Thu May 04 2023 17:41:30 GMT+0200
Screeb targeting engine status: disabledScreeb targeting engine: 3 surveys
Detected platform: desktopDetected locale: en-GBDetected timezone: -120**************************************************************- An empty channel id means the SDK was never initialized: check that the initialization runs, with the right channel id.
- An empty respondent id means your workspace reached its monthly user quota.
Read the targeting rules
Section titled “Read the targeting rules”The targeting debug lists each active survey with a link to it in Screeb, then each of its rules. A passing rule is marked green, a failing rule red: a red rule is the reason the survey does not show. Disabled surveys are not listed.
A survey or message does not show
Section titled “A survey or message does not show”Once the debug output looks right, check these causes in your code:
- The SDK starts once, with the right channel id. Initialize Screeb once, when the app starts. The same channel id works on the web, iOS and Android.
- The user is identified before the trigger. A rule on a user property or a group only matches after you identify the user and send that property. See Identity.
- The display hook lets it through. If you set
onSurveyDisplayAllowedoronMessageDisplayAllowed, it must returntruefor the survey or message to show. See Hooks. - Identity is not ignored. With the consent exemption mode on, Screeb ignores identity calls. See Consent exemption.
For everything else, go through My survey or message is not displayed.
Hooks are not called
Section titled “Hooks are not called”- Set
versionto"1.0.0". A missing or other version makes the whole call fail withUnexpected empty hooks versionorUnsupported hooks version. - Check the hook names against Hooks. An unknown name also makes the call fail, with
Unexpected hook type, so a typo in one hook can stop Screeb from starting. - Pass each hook where it applies: global hooks, such as
onReadyoronSurveyDisplayAllowed, only to the initialization; survey and message hooks to the initialization or to the call that starts the survey or message.
Too many anonymous users
Section titled “Too many anonymous users”Every user Screeb sees, identified or not, counts toward your monthly user quota.
- Keep Screeb out of your tests, CI and preview builds: initialize it only when your environment flag says the app runs for real users.
- When the user is already logged in at startup, pass their id to the initialization instead of identifying them later.
- Reset the identity only on logout. Each reset starts a new anonymous user.
To show nothing to visitors who never log in, turn on the “Ignore anonymous users” setting of your workspace, described in My survey or message is not displayed.
Nothing shows on Android
Section titled “Nothing shows on Android”-
The SDK needs network access, and its manifest does not request it. Add the permission to your app’s
AndroidManifest.xmlif it is not there yet:<uses-permission android:name="android.permission.INTERNET" /> -
Code shrinking needs no extra rule: the SDK ships its own ProGuard and R8 keep rules.
Kotlin Multiplatform: calls do not compile or do nothing
Section titled “Kotlin Multiplatform: calls do not compile or do nothing”Every method is a suspend function: call it from a coroutine. Each one returns null when the native call fails, so check the result while you set up.