How to use Snippet Injection on the booking widget

The Qudini online booking interface (booking widget) allows you to inject your own code snippets to allow you to have more flexibility over design and functionality. By leveraging this feature, you can take more control of your booking widget to add bespoke fonts, add Google analytics or manipulate elements on each page of the online booking journey.

Currently, this feature supports Script and Style HTML tags, meaning you can use JavaScript and CSS to manipulate your booking widget. We will be expanding its functionality in the future.

Please note:

Custom code modifications to the Qudini booking widget fall outside the scope of our support. This means that we’re unable to help with creating, managing, or troubleshooting any issues that are a result of the code snippets injected into the booking widget.

Additionally, with a code-based solution, we can’t guarantee its functionality or full compatibility with Qudini's booking widget. Custom code can also cause display and functionality issues with future updates to our platform.


Login to the Qudini Admin portal and navigate to Customisations > Online Booking Interface, then click Edit next to the Booking Widget you wish to update and go to the section called Snippet Injection.

There are two input fields respectively allowing to add elements at the top (appended to the Header) or at the bottom (appended to the Body) of the page.

If you are new to DOM manipulation, a good first read is Manipulating documents by MDN it will help you understand how it all works and show you how to target specific elements on the page.

Please note: Class names within the Booking Widget page may change, therefore we recommend using Id to target elements. Id's are static and will remain constant, so any snippets will remain uneffected by changes in Class names.


Customising your fonts

To use a new font you firstly need to import it, to do so we are using JavaScript to do DOM manipulation to create a link element with the href pointing to the source of the desire fonts.

After that we need to add a style tag to apply the font to the desired element, this example will apply the font to the entire body.

<script type="text/javascript" charset="UTF-8">
(function () {
var fontImport = document.createElement("link");
fontImport.setAttribute("href", "");
fontImport.setAttribute("rel", "stylesheet");
fontImport.setAttribute("type", "text/css");
body {
font-family: 'Lobster';

Adding a cookie policy banner

Here is an example with For your implementation, you will need to change the script-src alongside the if the condition as it should be based on the function that needs to be called to trigger the banner, this differs based on your provider.

<script type="text/javascript"

<script type="text/javascript" charset="UTF-8">
function onLoadPopupSmart() {
if (window.start && !!window.start.init && typeof window.start.init == "function") {
Mode:"banner bottom",
} else {
setTimeout(onLoadPopupSmart, 1000);

Adding Google Analytics tracking

It’s as simple as copy/paste the following in the Insert at the top of the page input field

<script type="text/javascript">
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

ga('create', 'UA-XXXXX-Y', 'auto'); // 'UA-XXXXX-Y' to be replaced
ga('send', 'pageview');

(source: Add analytics.js to Your Site  |  Analytics for Web (analytics.js))

You can then apply your API key by replacing 'UA-XXXXX-Y'

Did you find it helpful? Yes No