This guide shows you how to add Heyo to your WordPress site built with Elementor.
Since Elementor runs on WordPress, follow the WordPress installation guide for the complete setup.
Quick summary:
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
Add to your theme's functions.php:
function heyo_chat_widget() {
?>
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
<?php
}
add_action('wp_head', 'heyo_chat_widget');
For page-specific chat:
For site-wide integration:
To show chat trigger in a popup:
<script>
document.addEventListener('DOMContentLoaded', function() {
// Find Elementor buttons with specific class
const buttons = document.querySelectorAll('.heyo-chat-button');
buttons.forEach(button => {
button.addEventListener('click', function(e) {
e.preventDefault();
window.HEYO?.show();
});
});
});
</script>
heyo-chat-button to your button's Advanced > CSS ClassesCreate a beautiful custom button to open chat:
#heyo-chat<script>
jQuery(document).ready(function($) {
$('a[href="#heyo-chat"]').on('click', function(e) {
e.preventDefault();
window.HEYO?.show();
});
});
</script>
In Elementor, add an HTML widget:
<style>
#heyo-widget-button {
display: none !important;
}
</style>
Apply this on pages where you don't want the default chat button.
If using Elementor Pro's dynamic content:
<script>
window.addEventListener('load', function() {
if (window.HEYO) {
window.HEYO.init({
projectId: 'YOUR_PROJECT_ID',
user: {
// These would come from WordPress user data
name: '<?php echo esc_js(wp_get_current_user()->display_name); ?>',
email: '<?php echo esc_js(wp_get_current_user()->user_email); ?>'
}
});
}
});
</script>
Heyo is already optimized, but for best results:
For e-commerce sites:
function heyo_woocommerce_integration() {
if (is_product() || is_shop() || is_cart()) {
?>
<script src="https://heyo.so/embed/script" defer data-project-id="YOUR_PROJECT_ID"></script>
<?php
}
}
add_action('wp_head', 'heyo_woocommerce_integration');
This shows chat only on WooCommerce pages.
If chat button is behind Elementor elements:
<style>
#heyo-widget-button {
z-index: 99999 !important;
}
</style>
Heyo works with all Elementor themes:
Compatible with popular Elementor addons: