How to install Loopbear on your website
To unlock Loopbear's capabilities across your entire site, you'll only ever need one Javascript snippet. This Javascript snippet contains your SITE ID
, a unique identity string that tells Loopbear which site it is hosted on. We refer to this as the Loopbear script.
Copy your Loopbear script
Copy the code below and replace YOUR SITE ID
with your exact SITE ID
found on the setup page (opens in a new tab).
<script>
(function (b, e, a, r) {
b.lb =
b.lb ||
function () {
(b.lb.q = b.lb.q || []).push(arguments);
};
var head = e.getElementsByTagName("head")[0];
var script = e.createElement("script");
script.async = 1;
script.src = a;
script.setAttribute("site-id", "YOUR SITE ID");
head.appendChild(script);
})(
window,
document,
"https://www.loopbear.com/scripts/min/lb.js",
"loopbear"
);
</script>
Add the Loopbear script to your website
Once you have your specific SITE ID
added to your code above, you're ready to place it on your website. While this will be different depending on which type of platform (such as Shopify, Webflow, etc.) you are using, in general, you want to place this script just above the closing </body>
tag so that it is not render blocking.
An example showing where to place the Loopbear script is below:
<html>
<!-- 👾 super genius code you wrote here... -->
<!-- Loopbear script goes below -->
<script>
(function (b, e, a, r) {
b.lb = b.lb || function () {
(b.lb.q = b.lb.q || []).push(arguments);
};
const head = e.getElementsByTagName('head')[0];
const script = e.createElement('script');
script.async = 1;
script.src = a;
script.setAttribute('site-id', 'YOUR SITE ID');
head.appendChild(script);
})(window, document, "https://www.loopbear.com/scripts/lb.js", "loopbear");
</script>
<!-- closing body tag here -->
</body>
<!-- rest of your document... -->
</html>
How to add the Loopbear script to a website builder
If you're using a platform like Shopify, Webflow, Squarespace or something similar to design and host your website, you will need to refer to their documentation on how to add third-party scripts to your website. Usually, it is very simple to do and their support and communities can be helpful in aiding you if you're having troubles.
We have compiled resources below on how to add a third-party script like Loopbear for popular website builders:
- Squarespace (opens in a new tab)
- Shopify (opens in a new tab)
- Webflow (opens in a new tab)
- Wordpress (opens in a new tab)
- Weebly (opens in a new tab)
- Wix (opens in a new tab)
- GoDaddy (opens in a new tab)
- Framer (opens in a new tab)
- Ghost (opens in a new tab)
- Carrd (opens in a new tab)
If you're struggling to install Loopbear on your website, don't hesitate to reach out to us at support@loopbear.com, we'd be excited to help out.
Test installation
After you've saved your changes on your website and reload the page, you will notice that on the setup page (opens in a new tab) there will be a notification that tracked some activity and signals that you have completed the installation of the Loopbear script.
Whew! That's all the "code" that we will be doing and if you're not a developer, you won't need any more code to use the core capabilities of Loopbear (which is almost all of it).
But, if you're daring enough, there are some really cool things you can do with our on-page API. See you there!