On this page
What this issue is
Many buttons rely on JavaScript: to open a popup, submit a form, add an item to the cart, start a booking widget or open a chat. If that script hits an error, the browser stops running it. The button still looks normal, but clicking it does nothing: no popup, no page change, no message.
Common causes are a script that fails to load, a typo or a missing element (Cannot read properties of null), two scripts that conflict (for example two copies of jQuery), a plugin update, a tag manager change, or code that assumes something exists that does not on this page.
Why it costs you leads or sales
The visitor wanted to act and you gave them nothing. There is no error message, so most people click once or twice and leave. Because the page loads fine, you will not see a drop in traffic. You only see fewer leads or orders, and it is easy to blame the ads.
Example: 1,000 visitors a week, with the CTA working and then broken by a script error. Numbers are illustrative.
- Ad or search clickVisitor lands on the page
- Click the CTAScript throws an error
- Form or checkoutNever opens
- Lead or saleNever happens
The click never reaches the next step, so everything after it is lost.
The button looks fine, but the script behind it fails.
How to check if your site has it
Open the page in a private window
This avoids extensions and cached files affecting the result. Use the same URL your ads or links send people to.
Open the developer console
In Chrome, Edge or Firefox press F12 (or Cmd+Option+J on Mac Chrome), then choose the Console tab.
Reload and click the CTA
Watch for red lines such as
Uncaught TypeError,ReferenceErrororFailed to load resource.Read the file and line
The error links to a script file and line number. That tells you whether the cause is your theme, a plugin, a tag manager tag or a third-party widget.
Test on mobile
Use device mode in the developer tools, then a real phone. Some errors only happen on certain browsers or screen sizes.
How to fix it
The fix depends on what the error points to. Start with the most recent change: a plugin update, a new tag, a theme edit or a new popup tool.
Find the source file
If the error path contains /wp-content/plugins/NAME/, that plugin is the cause. If it contains /themes/, it is your theme.
Test for a conflict
Deactivate the plugin (or switch plugins off one at a time, ideally on a staging copy) and retest the click. Update it, replace it or contact its support.
Check optimisation plugins
In your caching or performance plugin, turn off JavaScript minify, combine and delay for the affected script, then clear the cache and retest.
Identify the app or theme code
If the error comes from an app script, disable the app embed under Online Store > Themes > Customize > App embeds and retest.
Check recent theme edits
In Online Store > Themes, open the theme's version history or compare with a duplicate of an earlier version to spot the change that broke the button.
Remove leftover app code
Uninstalled apps can leave snippets in theme.liquid. Remove references to scripts that no longer exist.
Use Preview mode
Click Preview, load the page and click the CTA. See which tags fired just before the error.
Pause the suspect tag
Custom HTML tags are the usual cause. Pause the tag, test again, then fix its code or add a try/catch.
Publish a fixed version
Submit the change with a clear version name so you can roll back if needed.
Check custom code
Review Site settings > Custom code and the page's own custom code for scripts that reference elements that no longer exist.
Check interactions and IDs
If you renamed or deleted the button, update any script that selects it by ID or class.
Republish
Publish the site and retest on the live domain, not only the staging webflow.io address.
Check custom code blocks
Open the funnel or website step and review custom JS or HTML elements and the tracking code in Settings for errors.
Test the button action
Make sure the button is set to a valid action (open popup, go to URL, submit form) and the target popup or form still exists.
Preview and publish
Save, preview in a private window and check the console again.
Check Custom Code
In Settings > Custom code, disable recently added scripts one at a time and retest.
Check Velo code
If Velo is on, open the page code and the browser console in Preview. Fix any reference to an element ID that was renamed.
Check the button link
Re-select the button and confirm its link or action is still set.
Review Code Injection
Open Settings > Advanced > Code Injection and any page-level code. Remove or fix scripts that error.
Check code blocks
Look at Code Blocks on the page for broken or duplicated scripts.
Retest after saving
Open the live page in a private window and click the button with the console open.
Guard against missing elements
Check that an element exists before attaching handlers, and run the code after the DOM is ready.
Isolate third-party scripts
Load non-essential scripts with async or defer so one failure does not stop your button code.
Add a no-JavaScript fallback
Where possible make the CTA a real link or a form submit so it still works if a script fails.
document.addEventListener('DOMContentLoaded', function () {
var btn = document.querySelector('#cta-button');
if (!btn) return; // element missing on this page, do nothing
btn.addEventListener('click', function (e) {
try {
// your popup, tracking or form logic here
} catch (err) {
console.error('CTA handler failed', err);
window.location.href = '/contact/'; // fallback so the visitor is not stuck
}
});
});Fragile
- Button is a div with only a JavaScript click handler
- Handler runs before the element exists
- One failed script stops everything
Resilient
- Button is a real link or submit button
- Handler waits for the page and checks the element
- Fallback sends the visitor to a working page
How to confirm it's fixed
- Console shows no new red errors when you load the page and click the CTA
- The popup, form, cart or next page opens as expected
- Works in Chrome, Safari and Firefox
- Works on a real phone, not only device mode
- Works in a private window with the cache cleared
- Form submission arrives in your inbox or CRM
- Conversion event still shows in GA4 or your ad platform
How to prevent it happening again
Most of these errors arrive with a change: a plugin update, a new tag, a theme edit or a new widget. Test the main CTA after each one.
Day 0
A plugin auto-updates and its script now errors on the landing page.
Day 1-6
Visitors click the CTA and nothing happens. Traffic looks normal.
Day 7
Someone notices leads are down and starts digging.
Day 7
The error is found in the console and the plugin is rolled back.
- Test updates on a staging copy first
- Click every main CTA after publishing site or tag manager changes
- Keep a list of scripts and tags on key pages and remove unused ones
- Avoid loading several versions of the same library
- Use real links and submit buttons where possible
- Run an automated click test on your key journeys on a schedule
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor runs your real customer journey on a schedule, clicks the CTA, and checks whether the expected next step happens. It also records console errors during the run. If the click leads nowhere, the check fails.
A failure is re-checked from a second region before one alert goes out, by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Test traffic is marked (utm_source=funnelguard, fg_test=1) and never bypasses CAPTCHAs or bot protection. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.
Questions people ask
Why does my button do nothing when I click it?
Most often a JavaScript error stopped the script that powers the button. Open the browser console (F12), click the button and look for a red error. It will name the file and line, which tells you if the cause is your theme, a plugin or a tag.
How do I find JavaScript errors on my website?
Open the page, press F12 and choose the Console tab. Reload the page and click the button. Red messages such as Uncaught TypeError or ReferenceError show what failed and where.
Why did my CTA button stop working after a plugin update?
The update may have changed a script that conflicts with another one, or removed an element your button relies on. Deactivate the plugin, retest, then roll back, update again or contact support. Test updates on a staging copy first.
Can Google Tag Manager break my buttons?
Yes. A Custom HTML tag with faulty code can throw an error that stops other scripts. Use GTM Preview mode, pause the suspect tag and click the button again to see if it works.
Why does the button work for me but not for visitors?
Your browser may have cached files, different extensions or a different device. Errors can also depend on browser, screen size, consent choices or logged-in state. Test in a private window, on mobile and in other browsers.
How can I make a CTA work even if JavaScript fails?
Use a real link or a form submit button instead of a div with a click handler. Add a fallback URL in your code so visitors still reach a working page if a script fails.
How do I know when a CTA breaks without checking by hand?
Run an automated journey check that clicks the CTA on a schedule and alerts you if the next step does not happen. FunnelGuard does this and also records console errors during the run.
Related issues
- CNV-094CTA button not clickable (covered by another element)Fix guide
- CNV-100CTA tracking event missing on clickFix guide
- CNV-102Mobile hamburger menu doesn't openFix guide
- CNV-097Anchor link (#form) scrolls nowhereFix guide
- CNV-092Main CTA links to a 404Fix guide
- CNV-093CTA links to the wrong page (old offer, wrong product)Fix guide