Embedding the squarelovin code on your website
The squarelovin SDK lets you show your UGC as shoppable widgets on your website. Our templates adapt to your website’s design and offer plenty of customization options.
Before you start
Section titled “Before you start”- You have a stream in squarelovin with the content you want to show.
- You can edit the HTML of your website, or someone on your team or your agency takes care of it.
Choose a template
Section titled “Choose a template”Gallery A full gallery that shows all media from your squarelovin stream. It’s a good way to give your customers plenty of inspiration at once.
- Purpose: Show UGC content in full size
- Placement: Dedicated gallery pages or pages that focus on UGC
Teaser A smaller widget with a single row and slide functionality. It usually sits on the homepage and links to the full gallery.
- Purpose: Grab attention and lead visitors to more UGC
- Placement: Homepages, landing pages
PDP (Product Detail Page) Works like the Teaser but shows only UGC for one specific product. This puts real customer content right next to the product on your product pages.
- Purpose: Show UGC for a product
- Placement: Product detail pages
Fullpage pop-up Opens single media items in a full screen view with linked products. The experience is bigger and more detailed than the standard pop-up.
- Purpose: Present single media items in detail
- Placement: Alongside other widgets or instead of the standard pop-up
Add the code to your website
Section titled “Add the code to your website”-
Add the global SDK code. Add this code to the
<head>section of your website:<script type="module" charset="utf-8" src="https://delivery-assets.squarelovin.com/sdk/squarelovin.min.js"></script>Add this code only once per page, even if the page has several widgets.
-
Add the widget container. Put the
<div>container where you want the stream to appear on your page:<div data-sq-container="sqln-container-id"data-sq-stream="stream-uuid"data-sq-sub="sub-uuid"data-sq-template="gallery"data-sq-lang="en_us"data-sq-import-on-load="outline"></div>You can copy the ready-made code with your IDs straight from your stream settings in squarelovin.
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
data-sq-container |
Unique ID for the widget |
data-sq-stream |
Stream UUID |
data-sq-sub |
Your squarelovin subscription UUID |
data-sq-template |
The template type: gallery, teaser or product-details |
data-sq-lang |
Widget language, for example de_de, en_us, fr_fr, es_es, it_it, nl_nl |
data-sq-import-on-load |
Loading behavior. Default value is outline. |
For PDP streams: Use data-sq-product to set the product ID or IDs. Separate multiple IDs with commas:
data-sq-product="product1,product2"For dynamic streams: Extra filters such as data-sq-category, data-sq-brand or data-sq-tag control which content the stream shows on each page. You’ll find all filters and examples in Dynamic streams.
Common issues
Section titled “Common issues”The widget does not appear.
Check that the SDK code is in the <head> of the page and that the IDs in the container match the code from your stream settings.