This script counts down to a fixed date and time, which suits events, launches, and limited-time offers that are days, weeks, or months away. For a short countdown measured in minutes, see How to Add a Countdown Timer to a Classic Builder Page.
This is community code, not an official Unbounce feature. Unbounce Support can't troubleshoot custom code. Test it on a published page before relying on it, and work with a developer if you aren't comfortable editing HTML, JavaScript, and CSS.
Add the timer to your page
The script is hosted on GitHub as Add a Countdown to a Date.
- Add a text element with the default text
00 days 00 hrs 00 mins 00 secsand style it to match your page. - Double-click the text element and open its source view. Wrap the innermost text in a
spanwithid="timer", so it looks like this:
<span id="timer">00 days 00 hrs 00 mins 00 secs</span>
- Copy the script from the gist and add it to the JavaScripts section with placement set to Before Body End Tag.
- In the script, enter the date and time you're counting down to.
- Save and republish the page.
