https://github.com/tcdent/squarespace-promotional-popup-onclick
Show a Squarespace Promotional Popup when a button is clicked.
Include the following embed code in the header of the page, either by Page Header Code Injection or or Developer Tools Code Injection.
<script type="text/javascript">
const SQUARESPACE_PROMOTIONAL_POPUP_ONCLICK_ANCHOR = "#subscribe";
</script>
<script src="https://cdn.statically.io/gh/tcdent/squarespace-promotional-popup-onclick/main/embed.min.js" type="text/javascript"></script>
Set one or more buttons on the page to link to your chosen anchor name (default: "#subscribe"
).
<a href="#subscribe">Subscribe</a>
- Under Display & Timing scroll to Timing.
- Show on a Timer and set the delay time to Immediately.
This will run this code to run on a single page on your site.
- In the Squarespace admin navigation, choose Pages.
- Hover over the page you wish to include the code, click the gear icon.
- Select Advanced.
- Paste the embed code above into the Page Header Code Injection field.
This will run this code on every page of your site.
- In the Squarespace admin navigation, choose Settings.
- Click Developer Tools.
- Click Code Injection.
- Paste the embed code above into the Header field.