Platform: LyveCom
**Intended Audience:**Shopify Developers, Ecommerce Managers
Displaying Collection-Specific Carousels in Shopify
Create dynamic, personalized carousels that match each collection—no extra page builders required.
Step 1: Create a Collection Metafield in Shopify
-
In your Shopify Admin, go to Settings → Custom Data → Collections.
Click Add Definition to create a new metafield.
Name it Lyvecom Carousel ID.
Set the content type as Single line text.
Save the metafield definition.
Step 2: Add the Carousel Embed Code to Your Theme
-
In your Shopify theme files, create a new section file named
lyvecom-carousel.liquid. Paste the following code into the new section:
1liquidCopyEdit<script data-lyvecom async src="https://dashboard.lyvecom.com/widget/widget.js"\></script>
2<div class="lyvecom_carousel--component-new" data-lyvecom-id="{{ collection.metafields.lyvecom.carousel_id }}"></div>
3<script>
4 (() => {
5 const scriptElement = document.querySelector('script[data-lyvecom]');
6 const mountCarousel = () => {
7 LyveComWidget.mountCarouselComponentV2({
8 carouselID: '{{ collection.metafields.lyvecom.carousel_id }}',
9 carousel: true,
10 lng: 'en'
11 });
12 }
13
14 if (window.LyveComWidget) {
15 mountCarousel();
16 } else {
17 scriptElement.addEventListener('load', mountCarousel);
18 }
19 })()
20</script>
21
- In your
collection.liquidor relevant template, add the section where you want the carousel to appear:
1liquidCopyEdit{% section 'lyvecom-carousel' %}
2
Placement Tip: Position the carousel below your collection banner or above the featured product grid for maximum visibility.
Step 3: Assign Carousel IDs to Collections
-
In your Shopify Admin, navigate to Collections.
Open a collection you’d like to feature a carousel on.
Locate the LyveCom Carousel ID metafield you created.
Paste the unique Carousel ID from your LyveCom dashboard into the metafield.
Save your changes.
Once this setup is complete, each collection will dynamically display its corresponding shoppable video carousel—creating a tailored, interactive shopping experience for your customers.
Have more questions? Reach out to our support team - we’re happy to help!
Happy selling! ✨
Was this article helpful?