Skip to content
Open Screeb

Add the Screeb SDK to your app and start it with your channel id, so surveys, messages and session replay can run.

Install the Screeb SDK once, at the start of your app, with the channel id of your workspace. Until a user is identified, Screeb tracks them as an anonymous visitor: see Identity to attach your own user id.

Your channel id is on the Install page of your workspace settings. The steps on the admin side are in the help center: Install Screeb on your website and Install Screeb in your mobile app.

The tag runs in every modern browser (Chrome 94+, Firefox 91+, Safari 15+, iOS 15+, Edge 94+). Older browsers (down to Chrome 61, Safari 12, iOS 11) automatically get a legacy bundle, so Screeb keeps working instead of failing to load.

The tag needs no package: it loads tag.js from <TAG-ENDPOINT> (https://t.screeb.app by default). Go to the next step. To serve the tag from your own domain, see Custom collector URL.

<!-- Screeb tag -->
<script>
(function(s,c,r,ee,b){
s.ScreebObject=r;
if(typeof s[r]!="function")s[r]=function(){var d=arguments;return new Promise(function(o,k){(s[r].q=s[r].q||[]).push({v:1,args:d,ok:o,ko:k})})};
b=c.createElement("script");b.id=r;b.src=ee;c.head.appendChild(b);
})(window,document,"$screeb","<TAG-ENDPOINT>/tag.js");
$screeb("init", "<YOUR-CHANNEL-ID>");
</script>
<!-- End of Screeb tag -->

Paste the tag at the end of every page, before </body>. It defines the $screeb function, loads tag.js and starts Screeb with init. Every $screeb(...) call returns a promise, and calls made before the tag has loaded wait in a queue.

When your Content Security Policy blocks inline scripts, declare the channel id on the script tag instead. The tag reads data-channel-id and starts itself. Keep id="$screeb": the tag uses that element to find the origin it was served from.

<script
async
id="$screeb"
src="<TAG-ENDPOINT>/tag.js"
data-channel-id="<YOUR-CHANNEL-ID>"
></script>

This form only carries the channel id. To call $screeb(...) from your own .js file, define the queue first: until the tag has loaded, window.$screeb is the script element itself, not a function.

if (typeof window.$screeb !== "function") {
window.$screeb = function () {
var args = arguments;
return new Promise(function (ok, ko) {
(window.$screeb.q = window.$screeb.q || []).push({ v: 1, args: args, ok: ok, ko: ko });
});
};
}

Do not use both forms: when your page calls init itself, the attribute is ignored. The full policy is in Security requirements.

Install with Google Tag Manager or Segment

Section titled “Install with Google Tag Manager or Segment”

You can install the tag without code, through the Screeb community template in Google Tag Manager or the Screeb Web (Actions) destination in Segment. Follow Install Screeb with Google Tag Manager or Segment. To keep the identity in sync when Screeb runs only through GTM, see Identity.

Surveys and messages follow the browser language. To force one, pass language to init. The language passed to survey.start wins over the one passed to init, which wins over the user’s language property, which wins over the browser.

$screeb("init", "<YOUR-CHANNEL-ID>", { language: "en" });

Screeb appends its surveys, messages and widgets to <body>. To put them somewhere else, pass root-container with a CSS selector or a DOM element. When the selector matches nothing, or the element gets detached, Screeb falls back to <body>.

$screeb("init", "<YOUR-CHANNEL-ID>", { "root-container": "#screeb-root" });

Some frameworks, such as Hotwire Turbo, replace the whole <body> on each navigation, which detaches Screeb. Use an element that survives the swap, such as "html" or a data-turbo-permanent node. You can also set the option before the tag loads, with the root_container key:

window.ScreebConfig = { root_container: "html" };

Stop Screeb at any time, for example when the user withdraws consent. It stays off until you start it again.

$screeb("close");