DistroShift · for your website
Adding the DistroShift booking button
One line of code puts a Book button in the bottom corner of every page. Clicking it opens online booking in a pop-up over your site, so visitors book without leaving it. These are the instructions for whoever looks after the website.
The line to add
The venue gives you its own line, copied from DistroShift (Booking settings → Floating button → Copy button code). It looks like this:
<script src="https://www.distroshift.com/embed/popup/YOUR-CODE.js" async></script>
Use the venue's own line, exactly as given. The code at the end is unique to that venue: it decides which diary bookings go into.
Install it
Add it once, to every page
Paste the line just before the closing
</body>tag, in the part of your site shared by every page (the footer or site-wide code area). Add it once only.Publish or save the site
Most website builders only apply custom code after you publish.
Check it
Open the live site in a fresh browser window and run through the checks below.
Where it goes, by website builder
Menu names change from time to time, but these are the usual places. Paste the line exactly as given.
| Builder | Where to paste the line |
|---|---|
| WordPress | A header-and-footer code plugin (for example WPCode): add it as a footer snippet, site-wide. Or, in a child theme, just before </body> in footer.php. |
| Wix | Settings → Custom code → Add custom code. Choose All pages and place it in Body – end. Wix allows custom code on premium plans with a connected domain. |
| Squarespace | Settings → Developer tools → Code injection → Footer. Available on plans that allow code injection. |
| Shopify | Online Store → Themes → ⋯ → Edit code → layout/theme.liquid, just before </body>. |
| Webflow | Site settings → Custom code → Footer code. Save, then publish. |
| Hand-built HTML | Just before </body> on each page, or once in a shared footer include. |
Check it works
- A Book button appears in the bottom corner of every page.
- Clicking it opens the booking page in a pop-up over the site.
- The pop-up closes with the ✕, the Escape key, or a click on the dimmed page around it.
- On a phone, the pop-up fills the screen and the page behind it does not scroll.
- Make a test booking only if the venue says so: it goes into their real diary.
Use your own buttons optional
Any existing “Book” link or button on the site can open the same pop-up. Add data-distroshift-book to it. With JavaScript on, it opens the pop-up; without, its link is followed, so point it at the booking page itself:
<a href="https://www.distroshift.com/embed/book/YOUR-CODE" data-distroshift-book>Book now</a>
Replace YOUR-CODE with the venue's code: the same code as in the line above.
Site scripts can also call DistroShiftBooking.open() and DistroShiftBooking.close().
Match your site's look optional
The button's text, colour and corner are set by the venue in DistroShift, and changes reach the site by themselves within a few minutes. Don't change them in the code.
For anything more (border, shape, font), or to hide the floating button where the site already has its own Book button, add CSS to the site. The html body prefix makes it take priority:
/* Square corners and a border, in the site's own style */
html body .dsbp-btn { border-radius: 0; border: 3px solid #000; }
/* Hide it on phones, where the site has its own Book button */
@media (max-width: 820px) { html body .dsbp-btn { display: none; } }If something isn't right
| What you see | What to do |
|---|---|
| No button at all | Clear any caching or optimisation plugin, and the CDN cache, then reload. Check the line was saved and the site published. |
| Still no button | A security policy or a cookie-consent tool may be blocking outside scripts. Allow https://www.distroshift.com for scripts and frames, e.g. script-src https://www.distroshift.com and frame-src https://www.distroshift.com in a Content-Security-Policy. |
| The button stopped working | The venue may have replaced its code (Rotate) or switched online booking off (Revoke). Ask them for the current line. |
| Wrong text or colour | That's set by the venue in DistroShift, not in the code. After they save, it updates on the site within a few minutes. |