Skip to main content
Version: Javascript tag

Troubleshooting

Check if Javascript tag is loaded correctly

Open the developer console and call the following Screeb command: $screeb('debug');.

You will get contextual information about the running user session:

image

Error cases

  • The error Uncaught ReferenceError: $screeb is not defined means the Javascript Tag was not injected into the page.
  • An empty channel id means you didn't call the $screeb('init', ...) command.
  • An empty respondent id means you exceeded your respondent quota.

Debug targeting rules

Since the targeting engine built by Screeb runs in the background, you may not understand which rules prevent your survey from being displayed to a user.

Open the developer console and call the following Screeb command: $screeb('targeting.debug');.

You will get a list of available surveys and the associated targeting rules:

image

The rules with a green dot 🟢 are the ones that have been validated for this user. The rules with a red dot 🔴 are not validated and may be the reason why your survey is not displayed.

Debug message conditions

Since the targeting engine built by Screeb runs in the background, you may not understand which rules prevent your message from being displayed to a user.

Open the developer console and call the following Screeb command: $screeb('message.debug');.

You will get a list of active messages and the associated conditions:

⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼ SCREEB MESSAGE DEBUG ⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼

Active message(s) [1]:
● <message-id>:
https://admin.screeb.app/org/<org-id>/survey/<message-id>/share

Type: "message"
Status: ACTIVE BUT NOT DISPLAYED 🟠
Conditions [2]:
🟢 Multiple displays: PASS
🔴 Time on page: FAIL - condition not met
⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼

The rules with a green dot 🟢 are the ones that have been validated for this user. The rules with a red dot 🔴 are not validated and may be the reason why your message is not displayed.

Possible message statuses:

StatusMeaning
DISPLAYED 🟢The message is currently visible to the user.
ACTIVE BUT NOT DISPLAYED 🟠The message is active but display conditions are not yet met.
IN PROGRESS 🟡The message is being loaded.
ENDED 🟣The user completed the message.
CLOSED 🔴The user dismissed the message.
INTERRUPTED ⚪️The message was interrupted before completion.

Content Security Policy (CSP)

You want to display Screeb surveys while being sure your app is secured and protected against injection attacks, here's how to make Screeb compatible with your Content Security Policy (CSP).

Your CSP should -at least- look like this:

default-src 'unsafe-inline' https://*.screeb.app wss://*.screeb.app; prefetch-src https://*.screeb.app; media-src https://*.screeb.app; font-src blob:

And don't forget to add your own domains.

An example:

content-security-policy: default-src https: 'unsafe-eval' 'unsafe-inline' https://*.screeb.app wss://*.screeb.app; object-src 'self'; report-uri /csp-violation-report; frame-ancestors 'self' https://admin.example.com https://vip.example.com; prefetch-src https://*.screeb.app; media-src https://*.screeb.app; font-src blob: