Skip to main content
All Collections
How to Set Up Your Widget on Your Website
How to Set Up Your Widget on Your Website

Discover how to configure the widget on your WordPress website.

Updated over 3 weeks ago

Steps to Install the Widget on Your Website

The Aloha widget allows you to easily integrate the booking system into your website, providing customers with a quick and simple way to book their stays. Its installation is simple and does not require advanced programming knowledge.

Below, we explain step by step how to add it to your website.

Step 1 - Add the Stylesheet

To ensure the widget displays correctly, you need to include the stylesheet in your webpage.

📌 Copy and paste the provided link inside the <head> section of your site. 📌

<link rel="stylesheet" href="https://booking-widget.aloha.co/aloha-booking-widget.css"/>

Step 2 - Add the Widget Container

📌 This container is where the widget will be displayed on your website.

Place it before the closing </body> tag of your site. 📌

<div id="aloha-widget"></div>

Step 3 - Assign a Unique ID to the Button to Open the Widget

To make the widget open when clicking on a specific button, you first need to assign it a unique ID. In Elementor, follow these steps:

  1. Open the Elementor editor and select the button you want to use.

  2. In the left sidebar, go to the “Content” section.

  3. In the "Button ID" field, assign a unique ID (e.g., btn-widget).

This ID is essential for linking the button to the script that will open the booking widget.


Step 4 - Get the Property Secret Key and Add the Script

The property secret key is necessary to authenticate the widget on your site. To obtain it:

  1. Go to Manage System in your admin panel.

  2. Select Widget.

  3. Copy the "Property Identification Key" shown there.

Step 5 - Add the Widget Script and Configure It

Once the button ID is set, add the script to load and open the widget when clicked.

Insert the provided script before the closing </body> tag of your website.

Make sure to replace 'YOUR_SECRET_KEY_HERE' with the secret key of your property.

📌 Copy and paste this code into the appropriate area:

<!-- Widget Aloha no tocar -->

<script>

var alohaObject = new AlohaBookingWidget({

key:'YOUR_SECRET_KEY_HERE'

});

var button = document.getElementById('btn-widget'); // Este es el ID único asignado al botón

// Agregar un event listener al botón

button.addEventListener('click', function (e) {

e.preventDefault();

// Llamar al método para abrir el widget cuando se hace clic en el botón

alohaObject.open();

});

</script>


With this setup, when your guests click the button with the ID btn-widget, the Aloha widget will open correctly.

Make sure to replace 'YOUR_SECRET_KEY_HERE' with the secret key of your property that you obtained from the system.

Did this answer your question?