Skip to main content

Shopify integration

Integrate Selektable into your Shopify store by adding the embed script and widget button to your product template.

Setup

1. Add the embed script

Add the script to your theme’s theme.liquid file, before the closing </body> tag. Replace store_xxx with your Store ID from the Selektable dashboard:

2. Add the widget button

Add the following to your product template (typically sections/main-product.liquid or similar):

3. Handle variant changes

Update the button data when the customer selects a different variant:
The variant:changed event name depends on your theme. Some themes use variantChange or dispatch custom events. Check your theme’s JavaScript for the correct event name.

Order webhooks

To enable conversion tracking, set up an order webhook:
  1. Go to Settings → Notifications → Webhooks
  2. Create a webhook:
    • Event: Order creation
    • URL: https://app.selektable.com/api/webhooks/shopify/orders
    • Format: JSON

Troubleshooting

This happens when Shopify’s Liquid filters produce incomplete URLs:
  • image_url returns protocol-relative URLs (//cdn.shopify.com/...). Always append | prepend: 'https:' after the image_url filter.
  • product.url returns a relative path (/products/...). Prepend shop.url to produce a full URL: {{ shop.url | append: product.url }}.
  • featured_image can be nil if a variant has no image. Use the default filter to fall back to the product’s featured image: product.selected_or_first_available_variant.featured_image | default: product.featured_image.
Make sure the embed script has loaded before calling Selektable.open(). The script loads asynchronously, so if your button fires before the script is ready, Selektable will be undefined.

Styling the button

Add CSS to match your theme: