Shopify Website Integration
How to integrate WebSDK in Shopify Website?
Process of integrating WebSDK in Shopify Website is very simple.
Copy paste the script at the bottom inside theme.liquid file.
<script>
const nector = {
style: {
btn: {
desktop: {}, // support props: top, bottom, left, right
mobile: {} // support props: top, bottom, left, right
},
popup: {
desktop: {} // support props: top, bottom, left, right
}
}
};
nector.api_key = "yourapikey"; // paste your api key here
nector.identifier = "shopify";
{% if customer %}
nector.business_customer_id = "{{customer.id}}";
{% endif %}
// nector.style.btn.desktop.bottom = "28px";
// nector.style.btn.desktop.left = "28px";
// nector.style.btn.mobile.bottom = "50px";
// nector.style.btn.mobile.left = "50px";
// nector.style.popup.desktop.bottom = "155px";
// nector.style.popup.desktop.left = "30px";
// nector.style.popup.desktop.left = "unset";
// renders the widgets
const randomString = "wSVNjD";
let elementId = `nector-rewards-widget-${randomString}`;
let rootElement = document.getElementById(elementId);
if (!rootElement) {
let newNectorElement = document.createElement("div");
newNectorElement.id = elementId;
document.body.appendChild(newNectorElement);
newNectorElement.style.zIndex = 100;
} else {
rootElement.style.zIndex = 100;
}
</script>
<script src="https://cdn.nector.io/nector-websdk-widget/main.min.js"></script>
Upon successful integration a widget will be rendered at the bottom-left of the screen. Widget popup is your user's rewarding view.
Last modified 1yr ago