On this page
What this issue is
A third-party script is code your page loads from another company's server, such as a chat widget, a review badge, an A/B testing tool or an analytics tag. When it is added as a plain <script src="..."> in the <head>, the browser stops building the page until that file has downloaded and run. This is called render-blocking.
- Visitor opens pageBrowser starts reading the HTML
- Sync third-party scriptVendor server is slow or down
- Page rendersWaits for the script or times out
- Form or checkoutNot visible or not usable
The vendor script hangs, so everything after it never loads.
Why it costs you leads or sales
Example: how a slow vendor script can delay the page. Numbers are illustrative, not measured.
The page waits on the vendor and never shows the form.
How to check if your site has it
View the page source
Open the page, right-click, choose View page source and search for
<script src=. Note any script from a domain that is not yours that has noasyncordeferattribute.Run Lighthouse
In Chrome, open DevTools, go to the Lighthouse tab and run a Performance report. Look at the audit called Eliminate render-blocking resources.
Check the Network tab
In DevTools open Network, reload, and sort by time. Find third-party requests that start early and take long.
Simulate a failure
In Network, right-click a vendor request and choose Block request URL, then reload. If the page stays blank or the form is missing, that script is a single point of failure.
How to fix it
| Attribute | Behaviour | Use for |
|---|---|---|
| none (default) | Blocks the page until downloaded and run | Almost never for third parties |
| async | Downloads in the background, runs as soon as ready | Independent scripts such as analytics or chat |
| defer | Downloads in the background, runs after the page is parsed, in order | Scripts that need the page to be built |
<!-- Before: blocks rendering -->
<script src="https://vendor.example.com/widget.js"></script>
<!-- After: does not block -->
<script async src="https://vendor.example.com/widget.js"></script>
<!-- or, if order matters -->
<script defer src="https://vendor.example.com/widget.js"></script>Find where the script is added
Check your theme's header.php, a header and footer scripts plugin, or the plugin that adds the widget.
Add async or defer
Edit the tag, or use your caching or performance plugin's option to defer JavaScript. Exclude scripts your form or checkout needs first, then test.
Open theme code
Go to Online Store, Themes, Edit code and open theme.liquid. Look for external script tags in the head.
Add defer and review apps
Add
deferorasyncto the tags you control. For app scripts, remove unused apps under Apps, as leftover code can remain in the theme.
Move the script into a tag
Create a Custom HTML tag with the vendor snippet and remove the hard-coded copy from the page.
Choose a trigger
Use the Window Loaded trigger for non-essential widgets so they never delay the first paint.
Open custom code
Go to Site settings, Custom code. Scripts in Head code load early.
Move or mark them
Move non-essential scripts to Footer code and add async or defer to the tag.
Use Custom Code
Go to Settings, Custom Code. Set the script to load in the Body - end position rather than Head.
Use Code Injection
Go to Settings, Developer Tools, Code Injection. Move vendor scripts from Header to Footer where possible and add async or defer.
Check tracking code fields
In the funnel or website settings, look at the Head tracking code and Footer tracking code. Move vendor scripts to the footer and add async or defer.
Add async or defer
Update every third-party script tag. Add
<link rel="preconnect" href="https://vendor.example.com">for scripts that must load early.Add a fallback
Make sure your form and checkout do not depend on the vendor global variable. Use
onerroror check the object exists before calling it.
// Only call the vendor API if it loaded
if (window.vendorWidget && typeof window.vendorWidget.init === 'function') {
window.vendorWidget.init();
}How to confirm it's fixed
- Lighthouse no longer lists the vendor script under Eliminate render-blocking resources
- With the vendor URL blocked in DevTools, the page still renders and the form shows
- The form still submits and the lead reaches your inbox
- Tracking tags still fire after the change
- The widget itself still appears, just a little later
Synchronous script
- Page hangs or stays blank
- Form never appears
- Visitors leave
Async, defer or tag manager
- Page renders normally
- Form and checkout work
- Only the widget is missing
How to prevent it happening again
- Add third-party scripts with async or defer by default
- Keep a list of every vendor script and who owns it
- Remove scripts for tools you stopped using
- Load non-essential widgets after the page is interactive
- Re-run Lighthouse after adding any new tool
- Never make the form or checkout depend on a vendor script
How FunnelGuard handles this
Questions people ask
Why is my page blank when a third-party script is slow?
If the script is loaded as a plain synchronous tag in the head, the browser stops building the page until it downloads. A slow or down vendor server leaves the page blank or half-drawn. Adding async or defer lets the page render without waiting.
What is the difference between async and defer?
Both download the script in the background without blocking the page. Async runs the script as soon as it is ready, in any order. Defer waits until the page is parsed and runs scripts in the order they appear.
How do I find render-blocking scripts on my website?
Run a Lighthouse Performance report in Chrome DevTools and open the Eliminate render-blocking resources audit. You can also search the page source for script tags from other domains with no async or defer.
How do I test what happens if a vendor script goes down?
In Chrome DevTools open the Network tab, right-click the vendor request and choose Block request URL, then reload. If your form, button or checkout disappears, that script is a single point of failure.
Does loading scripts through Google Tag Manager stop render blocking?
Usually yes, because the container loads asynchronously and tags fire after it. Use triggers like Window Loaded for non-essential widgets. A badly written Custom HTML tag can still cause problems, so test it.
Can FunnelGuard detect a render-blocking third-party script?
Only partly. It catches the effect when a script failure breaks a journey step, such as a missing form or button. It does not audit your source code for render-blocking tags, so check that by hand with Lighthouse.
Should I remove third-party scripts I no longer use?
Yes. Every extra script is another outside dependency that can slow or break your page. Remove tools you no longer use, and check theme files too, because leftover code often stays after an app is removed.
Related issues
- OPS-200Too many third-party scripts (performance and risk)Fix guide
- OPS-202Chat widget script failing to loadFix guide
- OPS-207Expired third-party SaaS subscription removing widget (reviews, popups)Fix guide
- OPS-203Chat widget covering CTA on mobileFix guide
- OPS-196Unknown third-party domain appears on checkout pageFix guide
- OPS-195Magecart / card skimmer script on checkoutFix guide