Where to Place the Code in Kajabi
Follow these steps to add the redirect functionality to your Kajabi site:
- Log in to your Kajabi account
- Navigate to the Website section
- Select the page with your subscription plans
- Click the "Edit" button to open the page editor
- Scroll to the very bottom of the page
- Add a new "Code Section" element
- Paste the JavaScript code into the code editor
- Save and publish your page
[Kajabi Editor Screenshot - Code Section Location]
Example of where to add a Code Section in the Kajabi editor
JavaScript Code to Copy
Copy this code
// Kajabi Subscription Redirect Script
(function() {
'use strict';
// Configuration - Plan names and their corresponding URLs
var planConfig = {
"GET STARTED": "https://buy.stripe.com/4gM4gs0XG26I4rW4RM7N600",
"JOIN ELITE": "https://buy.stripe.com/00wdR25dW12E5w0bga7N602",
"LEGENDARY": "https://buy.stripe.com/eVqfZaaygdPq4rWfwq7N601"
};
// Function to add redirect functionality
function initRedirects() {
var allElements = document.body.getElementsByTagName('*');
var count = 0;
for (var i = 0; i < allElements.length; i++) {
var element = allElements[i];
// Skip script, style, and code elements
if (element.tagName === 'SCRIPT' || element.tagName === 'STYLE' || element.tagName === 'CODE') {
continue;
}
var text = (element.textContent || element.innerText).trim();
if (!text) continue;
for (var planName in planConfig) {
if (text.indexOf(planName) !== -1) {
// Make element clickable
element.style.cursor = 'pointer';
// Add click event
element.addEventListener('click', function(e) {
window.location.href = planConfig[planName];
});
count++;
break;
}
}
}
if (count > 0) {
console.log('Kajabi redirect: Enhanced ' + count + ' elements');
}
}
// Initialize when page is loaded
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() {
setTimeout(initRedirects, 1000);
});
} else {
setTimeout(initRedirects, 1000);
}
})();
Important: This script should be placed in a Code Section at the bottom of your page. It will not modify your page layout or design.
How It Works
The script will automatically find elements containing these specific phrases:
- ✓ "GET STARTED" - $8.88 plan
- ✓ "JOIN ELITE" - $233.88 plan
- ✓ "LEGENDARY" - $44.88 plan
When these elements are clicked, users will be redirected to the corresponding payment page.
Note: The script waits 1 second after page load to ensure all elements are available. It only adds click functionality and doesn't change any visual styles.
Troubleshooting Tips
- Make sure the Code Section is at the bottom of your page
- Check that your subscription elements contain the exact text (case sensitive)
- If you have multiple elements with the same text, all will be made clickable
- Test the functionality after publishing your page