8.SDK Web (JavaScript SDK)

8.SDK Web

In order to display content in the shop, the 8.SDK Web (JavaScript SDK) must be integrated. The variable apiId must be filled with the API ID provided by us.

<script type="text/javascript">
    (function(d, s, w) {
      var apiId = '<API-ID>';
      w.eightlytics || function (w) {
          w.eightlytics = function () {
            window.eightlytics.queue = window.eightlytics.queue || [];
            window.eightlytics.queue.push(arguments);
          };
      }(w);
      var script = d.createElement(s);
      script.src   = 'https://wgt.8select.io/' + apiId + '/loader.js';
      var entry = d.getElementsByTagName(s)[0];
      entry.parentNode.insertBefore(script, entry);
    })(document, 'script', window);
</script>

The script should be placed as far up as possible in the DOM, preferably as first in the <head> tag to ensure it is executed as early as possible. Since the script is inserted dynamically, it is async by default and the loading of the page is not blocked. More about this here.

It is necessary to execute the script before you do the checkout tracking, otherwise tracking will not work.

The script is required on all pages where 8SELECT widgets are used. For transaction tracking, it must also be included on the page after checkout where the tracking can happen.

Last updated