Installing the ticket selection and check out widget to a Squarespace site

Learn how to add a widget to a Squarespace site.


1. Install Our Software Developer Kit

In order for the widget to function properly, you're going to have to add some code into the header of your website.

First, select Settings > Advanced > Code Injection

Then, post the following code into the header field: 

<script type="text/javascript">
(function (window, document, src) {
  var config = window.__shwps;
  if (typeof config === "undefined") {
    config = function () {
    config.q = [];
    config.c = function (args) {
    window.__shwps = config;

    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.async = true;
    s.src = src;
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
})(window, document, '');


2. Add the Button to Your Pages

To add the button to a page on your site: 

- After creating an event, copy your slug (the portion of the URL that comes after You can find this right next to the Event Name when editing your event or in the address bar of your event page. 

For example:

- On the page you'd like to add the button to, select the Tear Drop icon to add a new section.

- Click Code:

- Insert the following code, changing INSERT-EVENT-SLUG with your previous copied Slug

This code below could change based off of your current theme selection. 

<div class="sqs-block button-block sqs-block-button" data-block-type="53"><div class="sqs-block-content">
<div class="sqs-block-button-container--center" data-alignment="center" data-button-size="medium">
    <a href="#" onclick="'INSERT- EVENT-SLUG', {'theme-primary': '#ED0D0D', 'keep-shopping': true})" class="sqs-block-button-element--medium sqs-block-button-element" data-initialized="true">Buy Tickets</a>

This is the most important part important part of the code - it is what activates the widget

For Events:

onclick="'INSERT-EVENT-SLUG', {'theme-primary': '#ED0D0D', 'keep-shopping': true})"

For Products:

onclick="'productID', {'theme-primary': '#ED0D0D', 'keep-shopping': true})"

You can change the hex colour code #ED0D0D to match your brand colours.