This script will add redirect functionality to your existing subscription elements without modifying their appearance.
JavaScript Code:
// Subscription Redirect Script for Kajabi
(function() {
// Map of plan identifiers to Stripe URLs
const planUrls = {
"GET STARTED": "https://buy.stripe.com/4gM4gs0XG26I4rW4RM7N600",
"JOIN ELITE": "https://buy.stripe.com/00wdR25dW12E5w0bga7N602",
"LEGENDARY": "https://buy.stripe.com/eVqfZaaygdPq4rWfwq7N601"
};
// Function to find and enhance subscription elements
function enhanceSubscriptionElements() {
let elementsEnhanced = 0;
// Check all elements on the page
const allElements = document.querySelectorAll('*');
for (let i = 0; i < allElements.length; i++) {
const element = allElements[i];
const elementText = element.textContent.trim();
// Check if element text matches any plan identifier
for (const [planName, url] of Object.entries(planUrls)) {
if (elementText.includes(planName)) {
// Make element clickable without changing appearance
element.style.cursor = 'pointer';
// Add click event listener
element.addEventListener('click', function() {
window.location.href = url;
});
elementsEnhanced++;
break; // Stop checking other plans once a match is found
}
}
}
console.log('Subscription redirect script enhanced ' + elementsEnhanced + ' elements');
}
// Run the function after a short delay to ensure page is fully loaded
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() {
setTimeout(enhanceSubscriptionElements, 1000);
});
} else {
setTimeout(enhanceSubscriptionElements, 1000);
}
})();
Note: This script will not modify your existing page layout or styles. It only adds click event listeners to elements containing the specified text.
How to Use:
Copy the JavaScript code above
In Kajabi, edit your page with subscription plans
Add a Code Section element at the bottom of the page