Skip to main content

Add loader script

info

The loader script will read your config and setup a widget on every page where it finds an Online Sizing button.

tip

If you already use the Online Sizing Widget you can skip this step.

This loader script can be located anywhere on your page but has to come after the config. Otherwise you will get a JS error telling you that OZ_CONFIG is undefined.

<script>
((win, doc, script, key, config, src) => {
win['___OnlineSizing'] = key;
win['___OnlineSizingConfig'] = config;
const js = doc.createElement(script);
js.id = key;
js.src = src;
js.async = true;

const scripts = doc.getElementsByTagName(script);
const lastScript = scripts[scripts.length - 1];
lastScript.parentNode.insertBefore(js, lastScript);
})(window, document, 'script', 'oz', OZ_CONFIG, 'https://widgets.onlinesizing.bike/loader.js');
</script>