Paste the mandatory countdown timer code into your Kajabi landing page (only once per page). This code controls the time-sensitive offer. To display the countdown timer wherever you want, simply add it inside a custom code block. You can use the optional second timer to show the same countdown in multiple places on the same page. Note: the second timer only works when the mandatory code is also present on the page.
Optional: Select if you want to hide the timeline funnel code from the url. This makes the url more clean and only works when the cookie from step 2 is active.
Optional: You can also add this code to the thank you page after the first opt-in to show the timer immediately.
Advanced setting. Timeline code will be hidden from the url.
Default setting: Countdown timer is visible on landing page.
<style>
/* Timeline countdown timer code for Kajabi landing pages */
.timer-table {
width: 100%;
border-collapse: collapse;
}
.timer-table td {
text-align: center;
padding: 0px;
}
.timer-table .timer-cell {
font-size: 44px;
font-weight: bold;
}
.timer-table .timer-cell .background-cell {
color: #000000;
background-color: #f8f7f5;
border-radius: 0%;
width: 76px;
height: 76px;
display: flex;
justify-content: center;
align-items: center;
margin: auto;
}
.timer-table .label-cell {
font-size: 15px;
color: #ffffff;
}
.timercontainer {
padding: 11px;
background-color: #3b6362;
}
.flip-card {
perspective: 1000px;
width: 76px;
height: 76px;
display: inline-block;
}
.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.6s;
transform-style: flat;
transform-origin: center center;
}
.flip-card-front, .flip-card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
display: flex;
justify-content: center;
align-items: center;
border-radius: 35%;
}
.flip-card-inner.flipped {
transform: rotateX(180deg);
}
</style>
<div class="timercontainer" data-timer>
<table class="timer-table">
<tr>
<td class="timer-cell"><div class="background-cell" data-unit="dagen"></div></td>
<td class="timer-cell"><div class="background-cell" data-unit="uren"></div></td>
<td class="timer-cell"><div class="background-cell" data-unit="minuten"></div></td>
<td class="timer-cell"><div class="background-cell" data-unit="seconden"></div></td>
</tr>
<tr>
<td class="label-cell" kjb-settings-id="sections_timeline_countdown_settings_days">Days</td>
<td class="label-cell" kjb-settings-id="sections_timeline_countdown_settings_hours">Hours</td>
<td class="label-cell" kjb-settings-id="sections_timeline_countdown_settings_minutes">Mins</td>
<td class="label-cell" kjb-settings-id="sections_timeline_countdown_settings_seconds">Secs</td>
</tr>
</table>
</div>
<script>
function isInTestMode() {
const url = window.location.href;
const isKajabiAdmin = url.includes('app.kajabi.com/admin/themes/');
const previewParam = getQueryParam('preview_theme_id');
return isKajabiAdmin || previewParam;
}
function getQueryParam(name) {
const params = new URLSearchParams(window.location.search);
return params.get(name);
}
function setCookie(name, value, days) {
let expires = "";
if (days) {
const date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
function deleteCookie(name) {
document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/";
}
function getCookie(name) {
const nameEQ = name + "=";
const ca = document.cookie.split(';');
for (let i = 0; i < ca.length; i++) {
let c = ca[i].trim();
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
// URL opschonen als nodig
function hideQuery() {
if (!isInTestMode()) {
var url = window.location.href;
var newUrl = url.split('?')[0];
history.replaceState({}, document.title, newUrl);
}
}
function updateFlipCardUnit(timerEl, unit, value) {
let container = timerEl.querySelector('[data-unit="' + unit + '"]');
if (!container) return;
if (!container.querySelector('.flip-card')) {
container.innerHTML = `
<div class="flip-card">
<div class="flip-card-inner">
<div class="flip-card-front"><div class="background-cell">${value}</div></div>
<div class="flip-card-back"><div class="background-cell">${value}</div></div>
</div>
</div>
`;
} else {
const flipCardInner = container.querySelector('.flip-card-inner');
const front = flipCardInner.querySelector('.flip-card-front .background-cell');
const back = flipCardInner.querySelector('.flip-card-back .background-cell');
if (front.innerText != value) {
flipCardInner.classList.add('flipped');
setTimeout(() => {
front.innerText = value;
flipCardInner.classList.remove('flipped');
back.innerText = front.innerText;
}, 200);
}
}
}
const settings = {
setcookie: true,
setcookienumber: "3",
setcookiedays: 90,
tltimeendday: true,
tltimeday: 2,
tltimehour: 0,
tltimemin: 0,
tlenable_end_action: "redirect",
tlaction: "https://www.jiffycoursesonline.com/thank-you-timeline-funnel-bonus-demo-redirect",
useFlipAnimation: true
};
function isValidTParameter(t) {
const regex = new RegExp('^\\{\\{.*\\}\\}$');
return !regex.test(t);
}
function resterendeTijdTotEindeVanDag(tijdstempel) {
var startDay = new Date(tijdstempel);
var eindeVanDag = new Date(tijdstempel);
eindeVanDag.setHours(23, 59, 59, 999);
return eindeVanDag.getTime() - startDay.getTime();
}
function timelineCountdown(enddate, useFlipAnimation) {
var timer = setInterval(function () {
const now = new Date().getTime();
const diff = parseInt(enddate, 10) - now;
if (diff >= 0) {
const dagen = Math.floor(diff / (1000 * 60 * 60 * 24));
const uren = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minuten = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconden = Math.floor((diff % (1000 * 60)) / 1000);
document.querySelectorAll('[data-timer]').forEach(function (el) {
if (useFlipAnimation) {
updateFlipCardUnit(el, "dagen", dagen);
updateFlipCardUnit(el, "uren", uren);
updateFlipCardUnit(el, "minuten", minuten);
updateFlipCardUnit(el, "seconden", seconden);
} else {
el.querySelector('[data-unit="dagen"]').innerText = dagen;
el.querySelector('[data-unit="uren"]').innerText = uren;
el.querySelector('[data-unit="minuten"]').innerText = minuten;
el.querySelector('[data-unit="seconden"]').innerText = seconden;
}
});
} else {
clearInterval(timer);
if (!isInTestMode()) handleEndAction();
}
}, 1000);
}
function handleEndAction() {
if (!isInTestMode() && settings.tlenable_end_action === "redirect") {
window.location.replace(settings.tlaction);
}
}
function process(encodedData) {
const isTestMode = isInTestMode();
if (isTestMode) {
const now = new Date().getTime();
const offset = (settings.tltimeday * 86400000) + (settings.tltimehour * 3600000) + (settings.tltimemin * 60000);
const endOfDay = settings.tltimeendday ? resterendeTijdTotEindeVanDag(now) : 0;
const endTime = now + offset + endOfDay;
timelineCountdown(endTime, settings.useFlipAnimation);
return;
}
if (!encodedData) return handleEndAction();
const tlcdt = encodedData.toString().split("").reverse().join("");
const tlcsomEnd = tlcdt.indexOf("dC");
const tlcsom = parseInt(tlcdt.substring(2, tlcsomEnd), 10);
const tlctmEnd = tlcdt.indexOf("Gt");
const tlctm = tlcdt.substring(tlcsomEnd + 6, tlctmEnd);
const tlctmInt = parseInt(tlctm);
const tlcalsom = [...tlctm].reduce((sum, n) => sum + parseInt(n, 10), 0);
const tlgrt = tlcdt.match(/Hrf(.+?)fU/)?.[1];
const tlgrtl = tlctm.length;
if (tlcdt.includes("R1969") && tlcdt.includes("dC3729") && tlcalsom == tlcsom && tlgrt == tlgrtl) {
const now = new Date().getTime();
const offset = (settings.tltimeday * 86400000) + (settings.tltimehour * 3600000) + (settings.tltimemin * 60000);
const endOfDay = settings.tltimeendday ? resterendeTijdTotEindeVanDag(tlctmInt) : 0;
const endTime = tlctmInt + offset + endOfDay;
if (endTime > now) {
if (document.readyState === 'complete') {
timelineCountdown(endTime, settings.useFlipAnimation);
} else {
window.addEventListener('load', () => timelineCountdown(endTime, settings.useFlipAnimation));
}
} else {
handleEndAction();
}
} else {
handleEndAction();
}
}
// Zet dit stuk helemaal onderaan
function startTimer() {
try {
const encodedData = getQueryParam('t');
if (settings.setcookie) {
if (encodedData && isValidTParameter(encodedData)) {
setCookie(`timeline${settings.setcookienumber}`, encodedData, settings.setcookiedays);
}
} else {
// Remove cookie if disabled in settings
deleteCookie(`timeline${settings.setcookienumber}`);
}
const cookieData = getCookie(`timeline${settings.setcookienumber}`);
process(encodedData || cookieData);
hideQuery();
} catch (err) {
console.error("Fout in timeline timer:", err);
}
}
// Wacht tot pagina helemaal geladen is (ook afbeeldingen, scripts, etc.)
if (document.readyState === 'complete') {
startTimer();
} else {
window.addEventListener('load', startTimer);
}
</script>