Back to Setup
Shopify Integration

Shopify Integration Setup

Follow these simple steps to integrate BoostACart into your Shopify store and start capturing more leads.

Need Help Getting Started?

Our support team is here to assist you with the integration process.

1

Access Your Shopify Admin

Log in to your Shopify admin dashboard and navigate to your store's theme editor.

Path: Online Store → Themes → Click "Edit Code" on your active theme

2

Open theme.liquid File

In the code editor sidebar, locate and open the main layout file.

File: Layout/theme.liquid

3

Locate the Closing Body Tag

Scroll to the bottom of the file and find the closing body tag.

Look for: </body> and </html>

4

Paste the BoostACart Code

Copy the code below and paste it just before the closing </body> tag.

Position: Just before </body> and </html>

5

Save and Deploy

Click the "Save" button in Shopify to deploy your changes. Your BoostACart widget is now live!

Status: Changes are live immediately after saving

Embed Code

<!-- ========================= -->
<!-- BoostACart FINAL INSTALL -->
<!-- ========================= -->

{% if template contains 'product' %}
<script>
(function () {
  function getVariantId() {
    const input = document.querySelector('[name="id"]');
    return input ? input.value : null;
  }

  function getQuantity() {
    const qty = document.querySelector('[name="quantity"]');
    return qty ? parseInt(qty.value, 10) || 1 : 1;
  }

  document.addEventListener('click', async function (e) {
    const button = e.target.closest(
      'button[type="submit"], .add-to-cart, [aria-label*="Add to cart"]'
    );
    if (!button) return;

    e.preventDefault();

    const variantId = getVariantId();
    if (!variantId) return;

    const productData = {
      product_title: {{ product.title | json }},
      product_handle: {{ product.handle | json }},
      product_id: {{ product.id | json }},
      product_url: window.location.href,
      variant_id: variantId,
      quantity: getQuantity(),
      shop: "{{ shop.permanent_domain }}"
    };

    // 1️⃣ Add product to cart (AJAX-safe)
    await fetch('/cart/add.js', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        items: [{ id: variantId, quantity: productData.quantity }]
      })
    });

    // 2️⃣ Open widget in new tab
    const params = new URLSearchParams(productData).toString();
    const widgetUrl =
      'https://boostacaartt.netlify.app/widget/' +
      productData.shop +
      '?' +
      params;

    window.open(widgetUrl, '_blank');
  });
})();
</script>
{% endif %}

<!-- ========================= -->
<!-- End BoostACart -->
<!-- ========================= -->

Need Help?

If you encounter any issues during the integration process, our support team is here to help.