Skip to content

Javascript SDK install

Samuel Berthe edited this page Feb 25, 2022 · 11 revisions

How to add the Screeb tag to your website?

First, log in to the Screeb application, then create your first survey.

When your survey is ready to share, we will provide a javascript snippet to copy at the end of your HTML page (before </body>).

Example:

<script type="text/javascript">
  (function (s,c,r,ee,b) {
    s['ScreebObject']=r;s[r]=s[r]||function(){(s[r].q=s[r].q||[]).push(arguments)};
    b=c.createElement('script');b.type='text/javascript';
    b.id=r;b.src=ee;b.async=1;c.getElementsByTagName("head")[0].appendChild(b);
  }(window,document,'$screeb','https://t.screeb.app/tag.js'));

  $screeb('init', '<website-id>');
</script>

Commands

1- Screeb tag lifecycle

After the script tag is inserted into your page, you must call the init command, with your website ID (given in Screeb app). If no identity is specified, an anonymous Screeb session will be created (see "identity" section).

$screeb('init', '<website-id>');

You can disable the Screeb tag at any moment with the following command:

$screeb('close');

2- Identify visitors

See here.

3- Event tracking

See here.

4- Troubleshooting

See here.

Clone this wiki locally