On this page
What this issue is
Minification removes spaces, comments and long names from code so files are smaller. Combining (also called concatenating or bundling) joins many script files into one to save requests. Both are offered by cache plugins (WP Rocket, LiteSpeed Cache, W3 Total Cache, Autoptimize), by CDNs and by some hosts.
Why it costs you leads or sales
A single error can stop a form from submitting, a menu from opening, a payment button from loading or a tracking tag from firing. You keep paying for ad clicks, but visitors cannot convert, or conversions are not recorded and ad platforms optimise on bad data. The page looks normal to you, so it can stay broken for weeks.
- Ad clickVisitor lands on page
- Combined JS loadsConsole error: Uncaught ReferenceError
- Form or checkoutButton does nothing
- Conversion tagNever fires
A script error in the combined file stops later code from running.
Example: a form script breaks after a cache plugin update turns on combine JS.
How to check if your site has it
Open the page in a private window
Use the landing page, form page or checkout that matters. Private mode avoids extensions and logged-in cache bypass.
Open the console
Press F12 (or Cmd+Option+J on Mac), then choose the Console tab. Reload the page.
Look for red errors
Typical ones: Uncaught SyntaxError, Uncaught ReferenceError: jQuery is not defined, or $ is not a function. Note the file name, often a long hashed file in a cache or min folder.
Test the optimisation
Add a query string your plugin supports to skip optimisation (for example ?nowprocket on WP Rocket), or turn the setting off temporarily. If the error disappears, minify or combine is the cause.
Try the action
Submit the form and click the checkout or booking button. Check that the tracking tag fires in the Network tab.
How to fix it
The safest fix is to change one setting at a time. Turn off combine first, since it breaks scripts most often. Then, if needed, exclude the specific file from minify. Clear all caches after each change.
Turn off combine
In your cache plugin, find the file optimisation settings (WP Rocket: Settings > File Optimization; Autoptimize: Settings > Autoptimize; LiteSpeed: Page Optimization > JS Settings). Untick Combine JavaScript.
Exclude the broken file
Add the script name from the console error to the exclusion list for minify and combine. Also exclude jQuery if the error mentions it.
Clear caches
Purge the plugin cache, your host cache and any CDN cache, then retest.
Check apps and theme
Shopify minifies its own assets, so errors usually come from a speed or bundling app, or from a theme edit. Disable the app or bundling option and retest.
Review theme code
In Online Store > Themes > Edit code, check recent changes in theme.liquid for scripts loaded in the wrong order. Restore a previous version if needed.
Check custom HTML tags
If a tag was pasted in minified form and breaks, re-paste the original readable code. Use Preview mode to see which tag fails.
Keep tags separate
Make sure your site optimiser is not combining the GTM script into another file. Exclude googletagmanager.com from optimisation.
Turn off minify
Open Site settings > Publishing and untick Minify JS (and CSS, if relevant). Republish the site.
Check custom code
Look for missing semicolons or code that depends on a library loaded later, in Custom code or embeds. Fix and republish.
Review custom JS
In the funnel or website builder, open Settings > Custom Code (head or footer) and check for scripts that conflict. Remove or reorder them.
Test the published page
Preview can differ from the live page, so check the console on the live URL.
Review custom code
Wix handles minification itself. Check Settings > Custom Code for added scripts and remove any you recently added to see if the error stops.
Contact Wix support
If the error comes from a Wix-owned file, report it with the console message.
Check code injection
Open Settings > Advanced > Code Injection and look for scripts you added. Disable them one by one while checking the console.
Review your build
Check your bundler or minifier config (Terser, esbuild, webpack). Disable name mangling for the failing file, or load it separately.
Fix script order
Make sure libraries such as jQuery load before code that uses them. Use defer consistently.
Check the CDN
If your CDN offers auto minify or JS optimisation, turn it off for that file path or disable it and compare.
<script src="/js/jquery.min.js" defer></script>
<script src="/js/form-handler.js" defer></script>Broken
- Red error in the console
- Form button does nothing
- Conversion tags missing
Fixed
- Console is clean
- Form submits and shows thank-you page
- Tags fire on the thank-you step
How to confirm it's fixed
- Hard refresh the page and confirm the console has no red errors from your scripts
- Submit a real test lead and see it arrive in your inbox and CRM
- Start a checkout up to the payment step and confirm buttons work
- Check the Network tab for GA4, Ads and Meta requests on the key action
- Test on mobile and desktop
- Test in a private window so cache is not hiding the problem
How to prevent it happening again
Most breakages come from a plugin update, a new setting or a new script. Treat optimisation settings like code changes.
- Change one optimisation setting at a time and test the form and checkout straight after
- Keep a list of excluded files so you do not lose it after a plugin reset
- Prefer minify only; skip combine on HTTP/2 or HTTP/3 sites where it gives little gain
- Test updates on staging
- Clear every cache layer after a change
- Run an automated journey check after each deploy
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor runs your real journeys on a schedule, such as a lead form or checkout, and records the browser console errors it sees on the way. A script error from a minified or combined file shows up as a console error on that step, and the check also notes if the form fails or a tracking hit is missing.
A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. FunnelGuard points you to the error; you still need to decide which file to exclude. The Free plan covers 1 site and 2 journeys with daily checks, and paid plans start with a 3-day free trial.
One console error can stop the form and the tracking behind it.
Day 1
Combine JS is switched on to improve speed scores
Day 1
A script now loads before its library and throws an error
Days 2-10
Ad spend continues, form submissions drop unnoticed
Day 11
Console error found, file excluded, caches cleared
Questions people ask
Why did my form stop working after I enabled minify or combine JavaScript?
Combining or minifying changed how scripts load, so one now runs before something it needs or has been rewritten incorrectly. The browser throws an error and stops the code, which can include your form handler. Open the console to see which file fails, then exclude it.
How do I find which JavaScript file is breaking my site?
Open the page, press F12, go to the Console tab and reload. The red error shows the file name and line. Then turn off minify or combine briefly to confirm that it is the cause.
Should I combine JavaScript files on my website?
Often not. On modern HTTP/2 or HTTP/3 hosting, combining brings little speed gain and breaks scripts more often than minifying alone. If you do combine, test forms, checkout and tracking afterwards.
Can minification stop Google Ads or GA4 tracking?
Yes. If a script error stops code that sends the conversion event, or the tag script itself is altered, the hit never reaches the platform. Check the Network tab on the key action to see if the request is sent.
How do I exclude a script from minification in WordPress?
In your cache plugin's file optimisation settings, add the script's file name or path to the exclusion field for minify and combine JavaScript. In WP Rocket this is under Settings > File Optimization. Clear the cache afterwards.
Why does my site work when I'm logged in but break for visitors?
Many optimisation plugins skip minify or cache for logged-in users. Visitors get the optimised files, so the error only appears for them. Always test in a private window.
Does a Cloudflare auto minify setting break scripts?
It can if a file does not minify cleanly. If you use a CDN optimisation feature and see console errors, disable it for JavaScript and compare. Check your CDN's current settings, as options change.
Related issues
- OPS-116Rocket Loader / JS optimisation breaking tags or formsFix guide
- OPS-107CDN serving stale page after deployFix guide
- OPS-111Cache stripping UTM/gclid query paramsFix guide
- OPS-110Cached form nonce expired (form rejects submissions)Fix guide
- OPS-118Image CDN failing (broken images)Fix guide
- OPS-100Cloudflare/WAF blocks real visitors (challenge loops)Fix guide