Shopify Integration
Add the Ekoo widget to your Shopify store with Liquid
data-ekooReqdata-ekoo-product-idReqdata-ekoo-localeautodata-ekoo-variantdata-ekoo-review-iddata-ekoo-on-eventdata-ekoo-directionnormaldata-ekoo-scale1data-ekoo-animationpulsedata-ekoo-animation-durationcontinuousdata-ekoo-always-openfalsedata-ekoo-show-imagetruedata-ekoo-not-fully-clickablefalsedata-ekoo-autoplayfalsedata-ekoo-show-transcriptfalsedata-ekoo-show-speed-buttonfalsedata-ekoo-closed-state-main-textdata-ekoo-closed-state-secondary-textdata-ekoo-modeautodata-shadow-modeopenwindow.EKOO_FORCE_SPA = truewindow.ekooShadowMode = "open"1. Add the script to theme.liquid
The simplest method is to load the Ekoo script once in your theme.liquid (or layout/theme.liquid), just before the closing </body>tag:
1 <!-- Widget Ekoo -->2 <script src="https://app.ekoo.co/widgets/widget-4.0.0-standalone.js"</script>3</body>2. Add the container to the product page
In your product page template (sections/main-product.liquid or templates/product.liquid), add the widget container using Liquid variables:
1<ekoo-widget2 data-ekoo="YOUR_WEBSITE_ID"3 data-ekoo-product-id="{{ product.id }}"4 data-ekoo-locale="fr"5></ekoo-widget>product.id vs product.handle
You can use {{ product.id }} (Shopify numeric identifier) or {{ product.handle }} (URL slug) as the Product ID. Use whichever matches the configuration in your Ekoo backoffice.
3. Full example
1{% comment %} Existing product page {% endcomment %}2<div class="product-detail">3 <h1>{{ product.title }}</h1>4 <p>{{ product.description }}</p>56 {% comment %} Widget Ekoo {% endcomment %}7 <ekoo-widget8 data-ekoo="YOUR_WEBSITE_ID"9 data-ekoo-product-id="{{ product.id }}"10 data-ekoo-locale="{{ request.locale.iso_code }}"11 ></ekoo-widget>1213 <button type="submit" name="add" class="btn">14 Add to cart15 </button>16</div>The {{ request.locale.iso_code }} variable automatically adapts the widget language to the store's language (useful for multilingual stores).
4. Carousel variant
Warning
The carousel variant is not available in widget-4.0.0-standalone.js. It requires widget-3.1.0.js.
1<!-- ⚠️ Carousel requires widget-3.1.0.js — NOT available in 4.0.0-standalone -->2<ekoo-widget3 data-ekoo="YOUR_WEBSITE_ID"4 data-ekoo-product-id="{{ product.id }}"5 data-ekoo-type="carousel"6 data-ekoo-locale="{{ request.locale.iso_code }}"7></ekoo-widget>5. Dawn / OS 2.0 Compatibility
Shopify OS 2.0 themes (such as Dawn) use sections and blocks. Two options:
- Via the Theme Editor: add a Custom Liquid block in the product section and paste the
data-ekoocontainer code. - Via code: directly edit the
sections/main-product.liquidfile as described above.
Theme Editor recommended
For OS 2.0 themes, prefer adding via the Theme Editor. This avoids modifying the theme code and makes future theme updates easier.
1{% comment %}2 Paste this code into a "Custom Liquid" block3 via the Shopify Theme Editor.4{% endcomment %}5<ekoo-widget6 data-ekoo="YOUR_WEBSITE_ID"7 data-ekoo-product-id="{{ product.id }}"8 data-ekoo-locale="{{ request.locale.iso_code }}"9></ekoo-widget>