This guide shows you how to add Heyo to your Shopify store. Works with all Shopify plans including Shopify Plus.
theme.liquid under LayoutAdd this code before the closing </head> tag:
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
Click Save in the top right corner. The chat widget will now appear on your store!
Show customer information in your support inbox:
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
{% if customer %}
<script>
window.addEventListener('load', function() {
if (window.HEYO) {
window.HEYO.init({
projectId: 'YOUR_PROJECT_ID',
user: {
name: '{{ customer.name | escape }}',
email: '{{ customer.email | escape }}',
customerId: '{{ customer.id }}'
}
});
}
});
</script>
{% endif %}
{% if template contains 'product' %}
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
{% endif %}
{% if template contains 'cart' or checkout %}
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
{% endif %}
{% unless checkout %}
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
{% endunless %}
Send context about what products customers are viewing:
<!-- Add to product pages -->
{% if template contains 'product' %}
<script>
window.addEventListener('load', function() {
if (window.HEYO) {
window.HEYO.trackEvent('viewing_product', {
product: '{{ product.title | escape }}',
price: '{{ product.price | money }}',
url: '{{ product.url }}'
});
}
});
</script>
{% endif %}
Add a "Chat with us" button to your product pages:
<button
onclick="window.HEYO?.show()"
class="btn btn-primary"
style="margin: 20px 0;">
Questions? Chat with us!
</button>
Message customers who are hesitating at checkout:
Help customers find the right product:
Help with order tracking and questions:
{% if template contains 'thank-you' %}
<script>
window.addEventListener('load', function() {
if (window.HEYO) {
window.HEYO.init({
projectId: 'YOUR_PROJECT_ID',
user: {
name: '{{ customer.name | escape }}',
email: '{{ customer.email | escape }}',
orderNumber: '{{ order.name }}'
}
});
}
});
</script>
{% endif %}
Customize the widget to match your store's theme:
Control where the chat button appears:
<script>
window.addEventListener('load', function() {
if (window.HEYO) {
window.HEYO.config({
position: 'bottom-right', // or 'bottom-left'
});
}
});
</script>
For Shopify Plus merchants with access to checkout.liquid:
<!-- In checkout.liquid -->
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
Auto-detect customer language:
<script>
window.addEventListener('load', function() {
if (window.HEYO) {
window.HEYO.config({
language: '{{ request.locale.iso_code }}'
});
}
});
</script>
defer attributeCompatible with:
theme.liquid