Buy ticket buttons

Embed a Get tickets button on your own website. When someone clicks it, they go to a secure BooTickets checkout page for that event, with a link back to the page they came from.

Quick start

Open the event in your dashboard and choose Embed & QR code, then Copy HTML. Paste the code where you want the button to appear. It looks like this, with your event's ID filled in:

<!-- BooTickets CTA -->
<bootickets-cta event="<event-id>"></bootickets-cta>

<script async src="https://www.bootickets.com/embed/v1/loader.js"></script>

The button label reflects the event's status automatically — Get tickets, Sold out, Not yet on sale, and so on. You only need to include the <script> tag once per page, even if you show several buttons.

The button is a standard HTML custom element, so there's nothing to install and no framework code to write. It works in plain HTML, and in React, Vue or Angular you can write the tag directly in your template. (Angular rejects unknown tags, so add CUSTOM_ELEMENTS_SCHEMA to the component and bind the ID with [attr.event].)

Attributes

AttributeRequiredDescription
eventYesThe event ID to sell.
colorNoAccent colour for the button (any CSS colour).
langNoLanguage code for button text. Only en is available today.
<bootickets-cta event="<event-id>" color="#e11d48" lang="en"></bootickets-cta>

Button labels

The label and whether the button is clickable both follow the event's status:

StatusLabelClickable
On saleGet ticketsYes
Waiting listJoin waiting listYes
Sold outSold outNo
Not yet on saleNot yet on saleNo
Paused (you can't take payments right now)Tickets unavailableNo
Closed / pastThis event is in the pastNo

Tickets unavailable means the event is on sale but your payment provider isn't connected, so nobody can pay. Reconnect it under Account → Payments and the button goes back to Get tickets — see Connect payments.

While the status is loading the button shows a spinner. Other labels you might see:

  • Unavailable — the event couldn't be loaded at all (a wrong ID, a draft, or a network problem).
  • Missing event id — the event attribute is empty or missing.
  • Check back soon — the event has a status this version of the button doesn't recognise. Clicking it does nothing.

Events you can listen for

The widget dispatches DOM events on the page you can hook into for analytics:

EventFires when
bt:viewThe button is added to the page.
bt:statusThe event's status has loaded.
bt:clickThe buyer clicks the button.
<script>
  document.addEventListener('bt:status', (e) => {
    // e.detail = { id, status, event, venue, pricing }
    console.log(e.detail.event.name, e.detail.status);
  });
</script>

bt:status fires once per load, and the button loads twice when it first appears on the page, so write your handler to tolerate being called more than once.

After the click

The buyer finishes the purchase on the BooTickets checkout page, not on your site, so your page can't observe the sale — there's no purchase event to listen for. Once an order is paid:

  • the buyer gets their tickets by email, and
  • the order appears in your dashboard straight away.

To react to sales in your own systems, see Webhooks.

Rendering the event description yourself

bt:status hands you the whole event, so you can lay it out in your own page instead of using the button alone. Most fields are plain values, but the description is a structured document, not a string — the loader exposes the same renderer the event cards use so you don't have to walk it yourself:

<div id="desc"></div>

<script>
  document.addEventListener('bt:status', (e) => {
    const ev = e.detail.event;

    // Description: sanitised, with links and formatting preserved
    window.BooTickets.renderRichText(document.getElementById('desc'), ev.discovery.summary);

    // Hero image: join the key to the asset base
    const src = window.__BOOTICKETS_EMBED__.assetsBase + '/' + ev.discovery.heroImage.publicKey;
  });
</script>
FunctionReturns
renderRichText(container, doc)Nothing — replaces the container's contents.
richTextToHtml(doc)A sanitised HTML string.
richTextToPlainText(doc)Plain text, for meta descriptions and the like.

Bold, italic, links and line breaks are preserved; link URLs are restricted to http, https and mailto, and the output is sanitised before it reaches your page.

Opening checkout from your own code

If you'd rather trigger checkout from a button of your own, the loader exposes a small global API. Both functions send the browser to the BooTickets checkout page — despite the names, they no longer open a modal, and they don't return anything:

// Go to the ticket checkout for an event
window.BooTickets.openCheckoutModal({ event: { eventId: '<event-id>' } });

// Go to a donation checkout
window.BooTickets.openDonationModal({ customerId: '<organiser-id>' });

Each of these carries a return link back to the page the buyer started from. To change the button's colour, use the color attribute on <bootickets-cta>.

Showing a whole series

To list every event in a series on one page, each with its own booking button, use <bootickets-series> with the same loader script:

<bootickets-series series="<series-id>" template-url="/bootickets-series.html"></bootickets-series>

<script async src="https://www.bootickets.com/embed/v1/loader.js"></script>
AttributeRequiredDescription
seriesYesThe series ID. Open the series under Manage → Series; the ID is in the page address.
template-urlNoAn HTML file on your own site that sets out the layout. Defaults to /bt-series-example-template.html.
show-past-eventsNoAdd it to include events that have finished. They're hidden by default.

The template is yours to style. BooTickets fills in any element carrying these attributes and skips any it doesn't find:

<div class="series-container">
  <h2 data-bt-series-title></h2>
  <p data-bt-series-description></p>
  <p data-bt-series-subtitle></p>          <!-- the series date range -->

  <div data-bt-events></div>               <!-- event cards go here -->
  <div data-bt-loading>Loading events…</div>
  <div data-bt-error></div>

  <template data-bt-event-template>        <!-- copied once per event -->
    <div class="event">
      <h3 data-bt-ev-name></h3>
      <p data-bt-ev-tagline></p>           <!-- short tagline -->
      <div data-bt-ev-summary></div>       <!-- date and status -->
      <span data-bt-ev-venue></span>
      <a data-bt-ev-venue-map>View in map</a>
      <img data-bt-ev-image alt="" />
      <div data-bt-ev-content data-bt-clamp="8"></div>
      <button data-bt-buy>Book tickets</button>
    </div>
  </template>
</div>

data-bt-clamp="8" shortens a long description to eight lines behind a Read more… link.

Each event's button reads Book tickets, or Sold out or Sales closed (and can't be clicked) when that's the case. Clicking it sends the buyer to the BooTickets checkout, just like the single-event button. Past events are left out unless you add show-past-events, and a series with nothing coming up shows No upcoming events.